Exemple #1
0
        /// <summary>
        /// Create a new PopularDinner object.
        /// </summary>
        /// <param name="dinnerId">Initial value of the DinnerId property.</param>
        /// <param name="title">Initial value of the Title property.</param>
        /// <param name="eventDate">Initial value of the EventDate property.</param>
        /// <param name="description">Initial value of the Description property.</param>
        public static PopularDinner CreatePopularDinner(global::System.Guid dinnerId, global::System.String title, global::System.DateTime eventDate, global::System.String description)
        {
            PopularDinner popularDinner = new PopularDinner();

            popularDinner.DinnerId    = dinnerId;
            popularDinner.Title       = title;
            popularDinner.EventDate   = eventDate;
            popularDinner.Description = description;
            return(popularDinner);
        }
Exemple #2
0
 /// <summary>
 /// Deprecated Method for adding a new object to the PopularDinners EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPopularDinners(PopularDinner popularDinner)
 {
     base.AddObject("PopularDinners", popularDinner);
 }
 /// <summary>
 /// Create a new PopularDinner object.
 /// </summary>
 /// <param name="dinnerId">Initial value of the DinnerId property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="eventDate">Initial value of the EventDate property.</param>
 /// <param name="description">Initial value of the Description property.</param>
 public static PopularDinner CreatePopularDinner(global::System.Guid dinnerId, global::System.String title, global::System.DateTime eventDate, global::System.String description)
 {
     PopularDinner popularDinner = new PopularDinner();
     popularDinner.DinnerId = dinnerId;
     popularDinner.Title = title;
     popularDinner.EventDate = eventDate;
     popularDinner.Description = description;
     return popularDinner;
 }
 /// <summary>
 /// Deprecated Method for adding a new object to the PopularDinners EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToPopularDinners(PopularDinner popularDinner)
 {
     base.AddObject("PopularDinners", popularDinner);
 }
        private static JsonDinner JsonDinnerFromPopularDinner(PopularDinner popularDinner)
        {
            return new JsonDinner
            {
                DinnerId = popularDinner.DinnerId,
                EventDate = popularDinner.EventDate,
                Latitude = popularDinner.Latitude.GetValueOrDefault(),
                Longitude = popularDinner.Longitude.GetValueOrDefault(),
                Title = popularDinner.Title,
                Description = popularDinner.Description,
                RSVPCount = popularDinner.RsvpCount.GetValueOrDefault().ToString(),

                //TODO: Need to mock this out for testing...
                //Url = Url.RouteUrl("PrettyDetails", new { Id = dinner.DinnerID } )
                Url = popularDinner.DinnerId.ToString()
            };
        }
        private PopularDinner PopularDinnerFromDinner(Dinner dinner)
        {
            var result = new PopularDinner();
            foreach(var prop in typeof(Dinner).GetProperties()) {
                var propOnPopularDinner = typeof(PopularDinner).GetProperties().FirstOrDefault(p => p.Name == prop.Name);
                if(propOnPopularDinner==null) {
                    continue;
                }
                propOnPopularDinner.SetValue(result,prop.GetValue(dinner,null),null);
            }

            return result;
        }