Esempio n. 1
0
 /// <summary>
 /// Converts a WatchListEntity to WatchListModel.
 /// </summary>
 /// <param name="watchListEntity">WatchListEntity to be converted to WatchListModel.</param>
 /// <returns>WatchListModel corresponding to WatchListEntity.</returns>
 public static WatchListModel ConvertWatchListEntityToModel(WatchListEntity watchListEntity)
 {
     return(new WatchListModel
     {
         AlertRequired = watchListEntity.AlertRequired,
         AltNameOne = watchListEntity.AltNameOne,
         AltNameThree = watchListEntity.AltNameThree,
         AltNameTwo = watchListEntity.AltNameTwo,
         BseSymbol = watchListEntity.BseSymbol,
         CreatedOn = (watchListEntity.CreatedOn != null)
                                    ? DataFormatter.FormatDateToString(DataFormatter.GetDateTimeInLocalFormat(watchListEntity.CreatedOn))
                                    : null,
         IsActive = watchListEntity.IsActive,
         ModifiedOn = (watchListEntity.ModifiedOn != null)
                                     ? DataFormatter.FormatDateToString(DataFormatter.GetDateTimeInLocalFormat(watchListEntity.ModifiedOn))
                                     : null,
         Name = watchListEntity.Name,
         NseSymbol = watchListEntity.NseSymbol,
         TempName = watchListEntity.TempName,
         WatchListID = watchListEntity.WatchListID
     });
 }