Beispiel #1
0
 public List <IncomingRequest> GetIncomingRequests(int?top)
 {
     using (var db = new PochtaDbContext())
     {
         var i = db.IncomingRequests.OrderByDescending(x => x.Id);
         return((top.HasValue ? i.Take(top.Value) : i).ToList());
     }
 }
Beispiel #2
0
        public int InsertIncomingRequest(string str, string clientAddress)
        {
            using (var db = new PochtaDbContext())
            {
                IncomingRequest rInserted = db.IncomingRequests.Add(new IncomingRequest {
                    ClientAddress = clientAddress, Str = str, IncomedDate = DateTime.Now
                });
                db.SaveChanges();

                return(rInserted.Id);
            }
        }