SHARE
TWEET

Untitled

a guest Jul 19th, 2019 66 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.                     Employee[] emp = new Employee[5];
  3.  
  4.                     for (int i = 0; i < 5; i++)
  5.                     {
  6.                         emp[i] = context.Employees.SingleOrDefault(a => a.EmployeeId.Equals(i + 1));
  7.                     }
  8.  
  9.                     RequestStatus requestStatus1 = context.RequestStatuses.SingleOrDefault(a => a.RequestStatusId.Equals(1));
  10.                     Request request = new Request { };
  11.  
  12.                     for (int i = 0; i < 5; i++)
  13.                     {
  14.                         request = new Request { EmployeeRefId = emp[i].EmployeeId, RequestByRefId = emp[i].EmployeeId, RequestType = "GO", RequestedOn = DateTime.Today, Description = "Godišnji", RequestStatus = requestStatus1 };
  15.                         context.Add(request);
  16.                         context.SaveChanges();
  17.                     }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top