Exemple #1
0
 /// <summary>
 /// Gets the by id.
 /// </summary>
 /// <param name="id">The id.</param>
 /// <returns></returns>
 public TI GetById(long id)
 {
     using (var pc = PersistenceHelper.CreatePersistenceContext())
     {
         return((TI)((IBaseObject)BaseObject <T> .FindById(id)));
     }
 }
Exemple #2
0
        /// <summary>
        /// Deletes the physically.
        /// </summary>
        /// <param name="baseObjectInterface">The base object interface.</param>
        /// <returns></returns>
        public TI DeletePhysically(TI baseObjectInterface)
        {
            BaseObject <T> savedObject = null;

            using (var pc = PersistenceHelper.CreatePersistenceContext())
            {
                savedObject = BaseObject <T> .FindById(baseObjectInterface.Id);

                savedObject.Delete();
            }
            return((TI)((IBaseObject)savedObject));
        }