Questions tagged [slapper.automapper]

Slapper.AutoMapper ( Pronounced Slapper-Dot-Automapper ) is a mapping library that can convert dynamic data into static types and populate complex nested child objects. Use this tag for questions related to Slapper.AutoMapper auto mapper tool. In most cases, this tag should be used with other ORM/Micro-ORM tag. Exceptionally, this tag can be used independently when the tool is used independently OR issue is not related to ORM/Micro-ORM.

Slapper.AutoMapper converts C# dynamics and IDictionary<string, object> to strongly typed objects and supports populating an entire object graph by using underscore notation to underscore into nested objects.

This is not an ORM in itself but can easily be extended to create one. This library can be thought of as a building block of an ORM or used as an extension to an existing ORM or Micro-ORM. Slapper just handles the mapping part and essentially only has one input: a dictionary of property names and values.

The target audience is C# developers looking to enhance an ORM or write their own. Slapper.AutoMapper can take care of a lot of the hard work of mapping back to strongly typed objects.

GitHub URL: https://github.com/SlapperAutoMapper/Slapper.AutoMapper

6 questions
4
votes
1 answer

Slapper.Automapper with Dapper.net using Guid Ids

I need to map a one to many flattened SQL query into nested objects using Dapper.net. Slapper.Automapper seems a good way of doing this; as detailed in the answer to this question: How do I write one to many query in Dapper.Net? Erroneous dataset I…
niico
  • 11,206
  • 23
  • 78
  • 161
2
votes
0 answers

How to map multiple SQL relationships to c# objects

I'm developing a C# WPF desktop application where I need to read/write to an SQL database (SQL server) regularly. Now I want to map the data from the database to objects in C#. I can't use Entity Framework so I'm doing all my data access through…
maxiangelo
  • 125
  • 12
2
votes
1 answer

Slapper only maps one object when selecting multiple objects from database

I have some C# classes which represent database objects, some of which contain one or more other custom objects or enumerables of custom objects. I'm using dapper for queries, and slapper to map to the custom objects. It works great for single…
Joe.Flanigan
  • 736
  • 6
  • 18
2
votes
2 answers

Slapper & Dapper Dictionary Support

I am trying to map Dapper Data to an Object. But am facing problem while mapping to Dictionary objects. The Requirement is to map a Data Row to an Object. Data Row 1 | Key1 | Value1 1 | Key2 | Value2 Expected Values Id -> 1 Data -{{"Key1","Value1"…
1
vote
1 answer

Mapping List using Slapper

I've got the following code snippet in a repository class, using Dapper to query and Slapper.Automapper to map: class MyPocoClass{ MyPocoClassId int; ... } //later: var results = connection.Query("select MyPocoClassID,…
user1935361
  • 442
  • 3
  • 15
1
vote
1 answer

Slapper.AutoMapper returns only single result from list of objects

I've two POCO-s. A and B. public class A{ [Slapper.AutoMapper.Id] public int Id { get; set; } public B BType { get; set; } // Rest of the fields } public class B{ [Slapper.AutoMapper.Id] public int Id { get; set; } …
SNabi
  • 69
  • 1
  • 5