When using Mapster I'd like to have access to the parent object when mapping the children. How do I do this?
class Parent {
public int Id {get;set;}
public Child Child {get;set;}
}
class Child {
public int ParentId {get;set;}
public string…
I'm just starting to work with ASP.Net MVC Core and am trying to understand some of the differences between that and ASP,Net MVC Framework.
I use the Mapster library to organize the mappings between my data objects and the view models. In the old…
I am using ef core and mapster. I have some columns in my db that are nullable.
When I get them from the db, C# stores them as nulls(which makes sense). I want to return these fields are empty strings though when I send them back via my api.
public…
I have 2 service models and 2 DAL models. While creating new Author, I want to save its books to Book table. So, I send payload as json. However, If I try to adapt model to Book model, its values are null.So I can solve this problem. I also tried…
I use entity framework core 2.0 and mapster as object mapper.
An user can create news in my scenario.
I have this method:
public List GetMasterData()
{
IQueryable news = dbcontext.News;
IQueryable…
e.g. I have the following class:
public class TestClass
{
public List MyProperty { get; set; }
}
public class BaseClass {}
public class ClassA: BaseClass {}
public class ClassB: BaseClass {}
If I run the following code:
var…
I was looking to mapper which map my database model class to Viewmodel class.
I found AutoMapper, But It has performance issue, as it takes around 7-8 times than manual mapping, and also major drawback with AutoMapper is It retrieve all the column…
I have a Layer as Services and added a class as Mapper and i want to put all of my mapping here.
and i'm using asp.net core 5 and Mapster for mapping
am i do right?
this is my Code :
public class Mapping
{
public static void…
I have an issue where my mapping for a List to Dictionary won't map the Name to the Key property. The Value does fine. The implementation is below. System.ArgumentNullException: 'Value cannot be null.
Parameter name:…