Answer the question
In order to leave comments, you need to log in
How to describe a custom data type so that EF can properly serialize/deserialize it?
There is a model like this:
public class Pub
{
[Key]
public int Id { get; set; }
public string Name { get; set; }
public StringList Items { get; set; } // <--
}
public class StringList
{
...
public string Value
{
get { return this.ToString(); }
set { this.FillFromString(value); }
}
}
Answer the question
In order to leave comments, you need to log in
try to separate the Model from any logic,
personally in my opinion it would be very good
and convert from / to string / string, entrust someone else, you should not force the model to do this
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question