I have this structure in my sub context in my DDD (Sub domain).
Now I want to use my interfaces in my domain. For example, here is my news Entity:
public class News
{
public Guid Id { set; get; }
public string Subject { set; get; }
public string Content { set; get; }
public DateTime SubmitDatetime { set; get; }
public DateTime ModifiedDateTime { set; get; }
public string PublisherName { set; get; }
public string PictureAddress { set; get; }
public string TypeOfNews { set; get; }//etelaeie ya khabar
public HttpPostedFile ImageFile { get; set; }
}
Suppose I want to add, for example, a news item to my database. My main question is how can I add a news item to my database? Should I call my repository inside the news class and create a method inside the news class to do that?
Typically, the Application Service (in CMSManagement.Application
project) is the one that will
News
News
to itNews
to the DB (often by means of a Unit of Work)