@@ -7,7 +7,7 @@ Slapper.AutoMapper maps dynamic data to static types.
77<a href =" https://www.nuget.org/packages/Slapper.AutoMapper " ><img src =" https://img.shields.io/nuget/v/Slapper.AutoMapper.svg " alt =" NuGet Version " /></a >
88<a href =" https://www.nuget.org/packages/Slapper.AutoMapper " ><img src =" https://img.shields.io/nuget/dt/Slapper.AutoMapper.svg " alt =" NuGet Download Count " /></a >
99
10- ###What is it?###
10+ ### What is it? ###
1111
1212Slapper.AutoMapper ( Pronounced Slapper-Dot-Automapper ) is a mapping library that can convert dynamic data into
1313static types and populate complex nested child objects.
@@ -24,20 +24,20 @@ Answer: Yes and no but the philosophy of this project is much different. This sm
2424building block in a larger solution and puts a great emphasis on its ability to map to complex nested properties such as mapping
2525a Customer and it's list of Orders and it's list of OrderDetails.
2626
27- ###Is this an ORM?###
27+ ### Is this an ORM? ###
2828
2929No, this is not an ORM in itself but can easily be extended to create one. This library can be thought of as a building
3030block of an ORM or used as an extension to an existing ORM or Micro-ORM.
3131
3232ORMs typically query the database and then map the data into objects. Slapper just handles the mapping part and essentially
3333only has one input: a dictionary of property names and values.
3434
35- ###What problems does this solve?###
35+ ### What problems does this solve? ###
3636
3737Simply put, it allows you to convert dynamic data into strongly typed objects with ease and populating complex nested child
3838objects in your object hierarchy comes free out of the box --something severely lacking in almost every Micro-ORM solution!
3939
40- ###Auto mapping?###
40+ ### Auto mapping? ###
4141
4242Yep, Slapper.AutoMapper stays true to its name and allows auto-mapping between dynamic data and static types by using
4343conventions to find a given classes identifier ( the property that gives the class uniqueness ). This allows Slapper to
@@ -47,7 +47,7 @@ an attribute.
4747
4848And yes, multiple identifiers aka Composite Primary Keys are supported out of the box!
4949
50- ###Some more ramblings...###
50+ ### Some more ramblings... ###
5151
5252Micro-ORMs have been springing up left and right but many of them are quite basic in their functionality. Many have also
5353been opting for either very basic mapping to strongly typed objects or skipping it completely and opting for a completely
@@ -56,7 +56,7 @@ dynamic solution.
5656Dynamics are super cool and have their place but strongly typed objects have their place too and that is what this library
5757focuses on... converting dynamic data into strongly typed objects with strong support for populating nested child properties.
5858
59- ###Target Audience###
59+ ### Target Audience ###
6060
6161The target audience is C# developers looking to enhance an ORM or write their own. Slapper.AutoMapper
6262can take care of a lot of the hard work of mapping back to strongly typed objects.
@@ -78,7 +78,7 @@ Now let the slapping commence! :)
7878Usage - Mapping
7979===============
8080
81- ###Simple Example Using a Dictionary###
81+ ### Simple Example Using a Dictionary ###
8282
8383The following simple example maps a dictionary of property names and values to a Person class.
8484
@@ -112,7 +112,7 @@ public void Can_Map_Matching_Field_Names_With_Ease()
112112}
113113```
114114
115- ###Simple Example Using Dynamic###
115+ ### Simple Example Using Dynamic ###
116116
117117The following simple example maps a dynamic object to a Person class.
118118
@@ -146,7 +146,7 @@ public void Can_Map_Matching_Field_Names_Using_Dynamic()
146146}
147147```
148148
149- ###Mapping Nested Types Using a Dictionary###
149+ ### Mapping Nested Types Using a Dictionary ###
150150
151151The following example maps a list of dictionaries of property names and values to a Customer class and using underscore notation ("_ "),
152152Slapper.AutoMapper properly populates the nested child types. This is really what I would consider this libraries secret sauce.
@@ -288,7 +288,7 @@ public void I_Can_Map_Nested_Types_And_Resolve_Duplicate_Entries_Properly_Using_
288288Usage - Auto Mapping and Identifiers
289289====================================
290290
291- ###Auto Mapping###
291+ ### Auto Mapping ###
292292
293293Auto mapping allows Slapper to figure out how to effectively group objects together so that you do not get
294294duplicate results. Now internally, no actual grouping is happening but this is the easiest way to conceptualize
@@ -301,7 +301,7 @@ A classes identifier(s) play an important role in the ability of the mapper to e
301301identifiers are found, the mapper will still map the results to the requested type but there will be duplicates in the results.
302302
303303
304- ####Default Convention####
304+ #### Default Convention ####
305305Slapper.AutoMapper uses three different conventions in an attempt to locate/match a requested types
306306identifier:
307307- Id
@@ -313,15 +313,15 @@ For example, if your Customer object has any of the following properties or fiel
313313- CustomerId
314314- CustomerNbr
315315
316- ####Creating Your Own Convention####
316+ #### Creating Your Own Convention ####
317317
318318You can specify your own conventions very easily. The following example creates a convention of TypeName + _ Id:
319319
320320``` csharp
321321Slapper .AutoMapper .Configuration .IdentifierConventions .Add ( type => type .Name + " _Id" );
322322````
323323
324- ####Manually Specifying the Identifier(s)####
324+ #### Manually Specifying the Identifier(s) ####
325325
326326Slapper allows you to manually specify a classes identifiers . 1 through N number of identifiers are supported .
327327
@@ -343,7 +343,7 @@ public class Customer
343343Slapper .AutoMapper .Configuration .AddIdentifiers ( typeof ( Customer ), new List <string > { " CustomerId" , " CustomerType" } );
344344````
345345
346- ####Attribute-based Identifiers####
346+ #### Attribute-based Identifiers ####
347347
348348Slapper .AutoMapper also supports attribute - based identifiers .
349349
@@ -376,7 +376,7 @@ public class Customer
376376Usage - Caching
377377============== =
378378
379- ####Caching Explained####
379+ #### Caching Explained ####
380380
381381Slapper .AutoMapper internally maintains a cache of every object it creates , referred to as the instance cache .
382382This cache plays an important role in Slapper 's ability to easily lookup existing objects and ultimately assists
@@ -388,13 +388,13 @@ then there are going to be 50,000 objects in the cache for the lifetime of the c
388388The instance cache exists for the lifetime of the current thread and each of your application's threads will
389389get it's own unique cache making use of this library thread safe.
390390
391- ####Cache Backing Store####
391+ #### Cache Backing Store ####
392392
393393The instance cache backing store will either make use of the HttpContext if one exists or the CallContext of the
394394executing thread. The library makes use of reflection in order to persist the cache in the HttpContext when
395395neccessary so that the library does not require a dependency on the System.Web library.
396396
397- ####Clearing the Cache###
397+ #### Clearing the Cache ###
398398
399399Slapper never clears the cache because we feel that it should be the consumer of this library that should have that
400400responsibility.
@@ -406,7 +406,7 @@ Slapper.AutoMapper.Cache.ClearInstanceCache();
406406````
407407
408408
409- ###License###
409+ ### License ###
410410
411411MIT License :
412412
0 commit comments