Exemplo n.º 1
0
 /// <summary>
 /// Get an Event from the DTO
 /// </summary>
 /// <returns>an Event object for EF</returns>
 public Event GetEvent()
 {
     var repository = new TimekeepRepository();
     return new Event
     {
         Id = this.Id,
         User = repository.GetUser(this.UserId),
         Date = DateTime.Parse(this.Date),
         Hours = this.Hours,
         Client = this.Client,
         Category = repository.GetCategories().First(c => c.Name == this.Category || c.Id == this.CategoryId),
         CurrentStatus = (StatusEnum)this.CurrentStatusId,
         Description = this.Description
     };
 }