示例#1
0
 /// <summary>
 /// Deletes the entity from the database.
 /// </summary>
 ///
 /// <param name="userContext">
 /// User context.
 /// </param>
 ///
 /// <param name="entity">
 /// Entity to delete.
 /// </param>
 ///
 /// <returns>
 /// The number of affected rows.
 /// </returns>
 public int Delete(IUserContext userContext, VahapYigit.Test.Models.Role entity)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new RoleCrud(userContext))
         {
             return(db.Delete(entity));
         }
 }
示例#2
0
 /// <summary>
 /// Refreshs the entity instance from the database.
 /// </summary>
 ///
 /// <param name="userContext">
 /// User context.
 /// </param>
 ///
 /// <param name="appSettings">
 /// Entity to refresh (must be in database).
 /// </param>
 public void Refresh(IUserContext userContext, ref VahapYigit.Test.Models.Role entity)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new RoleCrud(userContext))
         {
             db.Refresh(ref entity);
         }
 }
示例#3
0
 /// <summary>
 /// Saves (or updates) the entity in the database.
 /// </summary>
 ///
 /// <param name="userContext">
 /// User context.
 /// </param>
 ///
 /// <param name="entity">
 /// Entity to save or update.
 /// </param>
 ///
 /// <param name="options">
 /// Optional options.
 /// </param>
 ///
 /// <returns>
 /// The number of affected rows.
 /// </returns>
 public int Save(IUserContext userContext, ref VahapYigit.Test.Models.Role entity, SaveOptions options = null)
 {
     using (var et = new ExecutionTracerService(tag: entity.State.ToString()))
         using (var db = new RoleCrud(userContext))
         {
             return(db.Save(ref entity, options));
         }
 }