コード例 #1
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.ExecutionTrace entity)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new ExecutionTraceCrud(userContext))
         {
             db.Refresh(ref entity);
         }
 }
コード例 #2
0
 /// <summary>
 /// Gets an entity given its unique ID.
 /// </summary>
 ///
 /// <param name="userContext">
 /// User context.
 /// </param>
 ///
 /// <param name="id">
 /// Unique ID.
 /// </param>
 ///
 /// <returns>
 /// The entity.
 /// </returns>
 public VahapYigit.Test.Models.ExecutionTrace GetById(IUserContext userContext, long id)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new ExecutionTraceCrud(userContext))
         {
             return(db.GetById(id));
         }
 }
コード例 #3
0
 /// <summary>
 /// Deletes the entity given its unique ID.
 /// </summary>
 ///
 /// <param name="userContext">
 /// User context.
 /// </param>
 ///
 /// <param name="id">
 /// Unique ID.
 /// </param>
 ///
 /// <returns>
 /// The number of affected rows.
 /// </returns>
 public int Delete(IUserContext userContext, long id)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new ExecutionTraceCrud(userContext))
         {
             return(db.Delete(id));
         }
 }
コード例 #4
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.ExecutionTrace entity)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new ExecutionTraceCrud(userContext))
         {
             return(db.Delete(entity));
         }
 }
コード例 #5
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.ExecutionTrace entity, SaveOptions options = null)
 {
     using (var et = new ExecutionTracerService(tag: entity.State.ToString()))
         using (var db = new ExecutionTraceCrud(userContext))
         {
             return(db.Save(ref entity, options));
         }
 }
コード例 #6
0
 /// <summary>
 /// Indicates whether the search returns at least 1 entity.
 /// </summary>
 ///
 /// <param name="userContext">
 /// User context.
 /// </param>
 ///
 /// <param name="options">
 /// Optional search options. If not defined, all records are returned.
 /// </param>
 ///
 /// <returns>
 /// True if the search returns at least 1 entity; otherwise, false.
 /// </returns>
 public bool HasResult(IUserContext userContext, SearchOptions options = null)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new ExecutionTraceCrud(userContext))
         {
             return(db.HasResult(options));
         }
 }
コード例 #7
0
 /// <summary>
 /// Gets entities with search options.
 /// </summary>
 ///
 /// <param name="userContext">
 /// User context.
 /// </param>
 ///
 /// <param name="options">
 /// Optional options, filters, orderby, paging, etc.
 /// </param>
 ///
 /// <returns>
 /// A collection of entities.
 /// </returns>
 public TCollection <VahapYigit.Test.Models.ExecutionTrace> Search(IUserContext userContext, ref SearchOptions options)
 {
     using (var et = new ExecutionTracerService())
         using (var db = new ExecutionTraceCrud(userContext))
         {
             return(db.Search(ref options));
         }
 }
コード例 #8
0
 public void Trace(IUserContext userContext, ExecutionTraceModel[] traces)
 {
     if (!traces.IsNullOrEmpty())
     {
         using (var db = new ExecutionTraceCrud(userContext))
         {
             db.Trace(traces);
         }
     }
 }