Beispiel #1
0
 public void SaveDevelopment <TDevelopment>(TDevelopment development)
     where TDevelopment : DevelopmentEntity
 {
     using (DatabaseContext context = CreateDatabaseContext())
     {
         PropertyRepository propertyRepository = context.Repository <PropertyRepository>();
         VDevelopment       vDevelopment       = propertyRepository.Save(development);
         context.SaveChanges();
         development.DevelopmentId = vDevelopment.DevelopmentId;
     }
 }
        public VDevelopmentFile(VDevelopment development, IFile file)
        {
            if (file == null)
            {
                return;
            }

            DevelopmentId  = development.DevelopmentId.GetValueOrDefault(0);
            FileId         = file.FileId;
            FileName       = file.FileName;
            SystemFileName = file.SystemFileName;
            MimeType       = file.MimeType;
            Flags          = file.Flags;
            LastUpdated    = file.LastUpdated;
        }
        public VDevelopment Save(IDevelopment development)
        {
            VDevelopment dataModel = new VDevelopment(development);

            if (_context.Development.Any(x => x.DevelopmentId == development.DevelopmentId))
            {
                Update(dataModel,
                       x => x.DevelopmentId,
                       x => x.Name,
                       x => x.Description
                       );
            }
            else
            {
                Add(dataModel);
            }

            return(dataModel);
        }
 public VDevelopment Add(VDevelopment development)
 {
     development.Rank = _context.Development.Max(x => x.Rank) + 1;
     return(Add <VDevelopment>(development));
 }