Esempio n. 1
0
 public ActorDetailsViewModel(ErrandActor errandActor)
 {
     Id = errandActor.Id;
     if (errandActor.Image != null)
     {
         Image = Convert.ToBase64String(errandActor.Image);
     }
     Name             = errandActor.Name;
     Active           = errandActor.IsActive;
     CreatedDate      = errandActor.CreatedDate.ToShortDateString();
     ModifiedDate     = errandActor.ModifiedDate.ToShortDateString();
     KilledById       = errandActor.KilledById;
     CompletedErrands = errandActor.Errands.Where(e => e.Status == ErrandStatus.Completed).Select(e => new ErrandViewModel(e)).ToArray();
     FailedErrands    = errandActor.Errands.Where(e => e.Status == ErrandStatus.Failed).Select(e => new ErrandViewModel(e)).ToArray();
     Type             = Enum.GetName(typeof(ActorType), errandActor.ActorType);
 }
Esempio n. 2
0
 public ErrandActorViewModel(ErrandActor actor)
 {
     Id        = actor.Id;
     Name      = actor.Name;
     ActorType = actor.ActorType;
 }