Ejemplo n.º 1
0
 public static DbEmdStructureViewModel CreateViewModel(this DbEmdStructure dbObject, long fileSize)
 {
     DbEmdStructureViewModel retVal = new DbEmdStructureViewModel();
     retVal.ID = dbObject.ID;
     retVal.Name = dbObject.Name;
     retVal.IsSelected = dbObject.IsSelected;
     retVal.Description = dbObject.Description;
     retVal.FileSize = fileSize;
     return retVal;
 }
 public void PostStructure(DbEmdStructureViewModel structure)
 {
     string userID = User.Identity.GetUserId();
     var query = m_repoFiles.DataQueryable().Where(item => item.ApplicationUserID == userID).Where(item => item.Structure.ID == structure.ID).FirstOrDefault();
     if (query == null)
     {
         return;
     }
     query.Structure.UpdateDb(structure);
     m_repoFiles.SaveChanges();
 }
Ejemplo n.º 3
0
 public static void UpdateDb(this DbEmdStructure dbObject, DbEmdStructureViewModel viewModel)
 {
     dbObject.IsSelected = viewModel.IsSelected;
     dbObject.Description = viewModel.Description;
 }