Inheritance: System.Data.Objects.DataClasses.EntityObject
 /// <summary>
 /// Create a new LineData object.
 /// </summary>
 /// <param name="id">Initial value of the Id property.</param>
 /// <param name="lineNumber">Initial value of the LineNumber property.</param>
 /// <param name="userDataId">Initial value of the UserDataId property.</param>
 /// <param name="phraseDataId">Initial value of the PhraseDataId property.</param>
 public static LineData CreateLineData(global::System.Guid id, global::System.Int32 lineNumber, global::System.Guid userDataId, global::System.Guid phraseDataId)
 {
     LineData lineData = new LineData();
     lineData.Id = id;
     lineData.LineNumber = lineNumber;
     lineData.UserDataId = userDataId;
     lineData.PhraseDataId = phraseDataId;
     return lineData;
 }
Beispiel #2
0
    public static void LoadDataFromDto(ref LineData data,
                                       LineDto dto, 
                                       LearnLanguagesContext context)
    {
      //USER INFO
      data.UserDataId = dto.UserId;
      data.UserData = EfHelper.GetUserData(dto.UserId, context);

      //PHRASE INFO
      data.PhraseDataId = dto.PhraseId;
      data.PhraseData = EfHelper.GetPhraseData(dto.PhraseId, context);

      //TEXT
      data.LineNumber = dto.LineNumber;
    }
 /// <summary>
 /// Deprecated Method for adding a new object to the LineDatas EntitySet. Consider using the .Add method of the associated ObjectSet&lt;T&gt; property instead.
 /// </summary>
 public void AddToLineDatas(LineData lineData)
 {
     base.AddObject("LineDatas", lineData);
 }
Beispiel #4
0
    public static LineDto ToDto(LineData data)
    {
      var dto = new LineDto()
      {
        Id = data.Id,
        LineNumber = data.LineNumber,
        PhraseId = data.PhraseDataId,
        UserId = data.UserDataId,
        Username = data.UserData.Username
      };

      return dto;
    }