Ejemplo n.º 1
0
        public MethodResult SaveOrUpdateAndFlush(T entity)
        {
            if (entity.Id == Guid.Empty)
            {
                return(SaveAndFlush(entity));
            }

            entity.TimeUpdate = DateTime.Now;
            entity.UserUpdate = CurrentUser.Id;

            Session.SaveOrUpdate(entity);
            Session.Flush();

            return(MethodResult.ReturnSuccess());
        }
Ejemplo n.º 2
0
        public MethodResult SaveAndFlush(T entity)
        {
            entity.Id = Guid.NewGuid();

            entity.TimeCreation = DateTime.Now;
            entity.TimeUpdate   = DateTime.Now;

            entity.UserCreation = CurrentUser.Id;
            entity.UserUpdate   = CurrentUser.Id;

            Session.Save(entity);
            Session.Flush();

            return(MethodResult.ReturnSuccess());
        }
Ejemplo n.º 3
0
 public MethodResult DeleteAndFlush(T entity)
 {
     Session.Delete(entity);
     Session.Flush();
     return(MethodResult.ReturnSuccess());
 }