public RegisteredRequestFile CreateFile(CreateRequestFile createRequestFile) { using (HelpDeskDataContext helpDeskDataContext = new HelpDeskDataContext()) { var newRequestFile = createRequestFile.ToEntity(); helpDeskDataContext.Files.Add(newRequestFile); helpDeskDataContext.SaveChanges(); return(newRequestFile.ToDTO()); } }
public static RequestFile ToEntity(this CreateRequestFile newRegistry) { return(new RequestFile() { Source = newRegistry.Source , FileName = newRegistry.FileName , RequestId = newRegistry.RequestId , CreateDate = DateTime.Now , State = 1 }); }