Inheritance: System.Data.Objects.DataClasses.EntityObject
 /// <summary>
 /// Create a new MultiLineTextData object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="title">Initial value of the Title property.</param>
 /// <param name="additionalMetadata">Initial value of the AdditionalMetadata property.</param>
 /// <param name="userDataId">Initial value of the UserDataId property.</param>
 public static MultiLineTextData CreateMultiLineTextData(global::System.Guid id, global::System.String title, global::System.String additionalMetadata, global::System.Guid userDataId)
 {
     MultiLineTextData multiLineTextData = new MultiLineTextData();
     multiLineTextData.Id = id;
     multiLineTextData.Title = title;
     multiLineTextData.AdditionalMetadata = additionalMetadata;
     multiLineTextData.UserDataId = userDataId;
     return multiLineTextData;
 }
Exemple #2
0
    public static void LoadDataFromDto(ref MultiLineTextData data,
                                       MultiLineTextDto dto, 
                                       LearnLanguagesContext context)
    {
      //USER INFO
      data.UserDataId = dto.UserId;
      data.UserData = EfHelper.GetUserData(dto.UserId, context);

      //LINE IDS
      foreach (var id in dto.LineIds)
      {
        LineData lineData = EfHelper.GetLineData(id, context);
        data.LineDatas.Add(lineData);
      }

      //SCALAR
      data.Title = dto.Title;
      data.AdditionalMetadata = dto.AdditionalMetadata;
    }
 /// <summary>
 /// Deprecated Method for adding a new object to the MultiLineTextDatas EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToMultiLineTextDatas(MultiLineTextData multiLineTextData)
 {
     base.AddObject("MultiLineTextDatas", multiLineTextData);
 }
Exemple #4
0
    public static MultiLineTextDto ToDto(MultiLineTextData data)
    {
      var dto = new MultiLineTextDto()
      {
        Id = data.Id,
        AdditionalMetadata = data.AdditionalMetadata,
        LineIds = (from line in data.LineDatas
                   select line.Id).ToList(),
        Title = data.Title,
        UserId = data.UserDataId,
        Username = data.UserData.Username,
      };

      return dto;
    }