Beispiel #1
0
 public async Task <ValueEntity> Get(Guid id)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.Values.Find(id);
         return(entity);
     }
 }
 public async Task <FormDetailsTypeEntity> Get(Guid id)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.FormDetailsTypes.Find(id);
         return(entity);
     }
 }
 public async Task <FormUserAuthorizationEntity> Get(Guid id)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.FormUserAuthorizations.Find(id);
         return(entity);
     }
 }
 public AspNetUsersInfoEntity Create(AspNetUsersInfoEntity item)
 {
     using (var context = new FormsEntities())
     {
         context.AspNetUsersInfoes.Add(item);
         context.SaveChanges();
         return(item);
     }
 }
 public async void Delete(Guid id)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.FormDetailsTypes.Find(id);
         context.FormDetailsTypes.Remove(entity);
         context.SaveChanges();
     }
 }
Beispiel #6
0
 public async Task <ValueEntity> Update(Guid id, ValueEntity item)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.Values.Find(id);
         entity.ModifiedDateTime = DateTime.Now;
         context.SaveChanges();
         return(entity);
     }
 }
 public async Task <FormDetailsTypeEntity> Create(FormDetailsTypeEntity item)
 {
     using (var context = new FormsEntities())
     {
         item.Id = Guid.NewGuid();
         item.CreatedDateTime = DateTime.Now;
         var entity = context.FormDetailsTypes.Add(item);
         context.SaveChanges();
         return(entity);
     }
 }
 public async Task <FormDetailsTypeEntity> Update(Guid id, FormDetailsTypeEntity item)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.FormDetailsTypes.Find(id);
         entity.Name             = item.Name;
         entity.ModifiedDateTime = DateTime.Now;
         context.SaveChanges();
         return(entity);
     }
 }
Beispiel #9
0
 public async void Delete(Guid id)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.Values.Find(id);
         if (entity != null)
         {
             context.Values.Remove(entity);
             context.SaveChanges();
         }
     }
 }
Beispiel #10
0
 public async Task <FormEntity> Update(Guid id, FormEntity item)
 {
     using (var context = new FormsEntities())
     {
         var entity = context.Forms.Find(id);
         entity.Name             = item.Name;
         entity.Description      = item.Description;
         entity.PublishUrl       = item.PublishUrl;
         entity.ModifiedDateTime = DateTime.Now;
         context.SaveChanges();
         return(entity);
     }
 }
Beispiel #11
0
 public async Task <ValueEntity> Create(ValueEntity item)
 {
     using (var context = new FormsEntities())
     {
         if (item.Id == null || item.Id == Guid.Empty)
         {
             item.Id = Guid.NewGuid();
         }
         else
         {
             item.Id = new Guid(item.Id.ToString());
         }
         item.CreatedDateTime = DateTime.Now;
         context.Values.Add(item);
         context.SaveChanges();
         return(item);
     }
 }
    private void DoFireAndForgetAsync(XXX model)
    {
        try
        {
            using (var ctx = new FormsEntities())
            {
                var dbXXX = new DALXXX();
                dbXXX.Foo = model.Foo;

                ctx.DALXXX.Add(dbXXX);
                ctx.SaveChanges();
            }
        }catch (Exception ex)
        {
            // Remember that the Async code needs to handle its own
            // exceptions, as the "DoFireAndForget" method will never fail
            Log.Log.LogError(ex.GetMostInnerException(), "whatever");
        }
    }
 public FormUserAuthorizationRepository()
 {
     this.context = new FormsEntities();
 }
Beispiel #14
0
 public ValueReadRepository()
 {
     this.context = new FormsEntities();
 }
Beispiel #15
0
 public AspNetUsersRepository()
 {
     this.context = new FormsEntities();
 }
Beispiel #16
0
 public FormRepository()
 {
     this.context = new FormsEntities();
 }
 public FormDetailsTypeRepository()
 {
     this.context = new FormsEntities();
 }
Beispiel #18
0
 public FormDetailsOptionsRepository()
 {
     this.context = new FormsEntities();
 }
Beispiel #19
0
 public ValueDetailsRepository()
 {
     this.context = new FormsEntities();
 }