예제 #1
0
        public override DynamicJsonValue ToJson()
        {
            var result = base.ToJson();

            result[nameof(OperationId)]         = OperationId;
            result[nameof(State)]               = State.ToJson();
            result[nameof(Killable)]            = Killable;
            result[nameof(TaskType)]            = TaskType.ToString();
            result[nameof(StartTime)]           = StartTime;
            result[nameof(EndTime)]             = EndTime;
            result[nameof(DetailedDescription)] = DetailedDescription?.ToJson();

            return(result);
        }
예제 #2
0
 public override bool Equals(object obj)
 {
     try
     {
         Film filmToCompareTo = (Film)obj;
         return(IsReleased == filmToCompareTo.IsReleased &&
                Title.Equals(filmToCompareTo.Title) &&
                Id.Equals(filmToCompareTo.Id) &&
                Length.Equals(filmToCompareTo.Length) &&
                BriefDescription.Equals(filmToCompareTo.BriefDescription) &&
                DetailedDescription.Equals(filmToCompareTo.DetailedDescription) &&
                ImagePath.Equals(filmToCompareTo.ImagePath) &&
                Year.Equals(filmToCompareTo.Year) &&
                Classification.Equals(filmToCompareTo.Classification) &&
                compareStringArr(Directors, filmToCompareTo.Directors) &&
                compareStringArr(Actors, filmToCompareTo.Actors) &&
                compareStringArr(Genres, filmToCompareTo.Genres));
     }
     catch (Exception)
     {
         return(false);
     }
 }