Example #1
0
        public int RunNonQuery()
        {
            using (var context = new ORMTestEntities())
            {
                var outputParam = new ObjectParameter("OutputData", SqlDbType.Int);
                context.ExecuteNonQuery(outputParam, 1, Guid.NewGuid(), "string", true, DateTime.Now);

                return((int)outputParam.Value);
            }
        }
Example #2
0
 public List <Dto> SelectAll()
 {
     using (var context = new ORMTestEntities())
     {
         var results = context.GetAllRecords();
         return(results.Select(result => new Dto()
         {
             BoolData = result.BoolData,
             DateData = result.DateData,
             IntData = result.IntData,
             GuidData = result.GuidData,
             StringData = result.StringData
         }).ToList());
     }
 }
Example #3
0
 public Dto SelectOne(int id)
 {
     using (var context = new ORMTestEntities())
     {
         var result = context.GetSingleRecord(id).First();
         return(new Dto()
         {
             BoolData = result.BoolData,
             DateData = result.DateData,
             IntData = result.IntData,
             GuidData = result.GuidData,
             StringData = result.StringData
         });
     }
 }