Converter
Maxime ROCHER 4 months ago
parent 1e2a18613e
commit cd9edeb2fa

@ -5,14 +5,55 @@ namespace WF_WebAdmin.Converter
{
public class QuoteDTO
{
private int id_quote;
private string content;
private int likes;
private string langue;
private bool isValide;
private string? reason;
private int id_caracter;
private int id_source;
private int? id_user_verif;
public int Id { get; set; }
public string Content { get; set; }
public int Likes { get; set; }
public string Langue { get; set; }
public bool IsValide { get; set; }
public string? Reason { get; set; }
public int IdCaracter { get; set; }
public int IdSource { get; set; }
public int? IdUserVerif { get; set; }
public QuoteDTO(int id_quote, string content, int likes, string langue, bool isValide, string? reason, int id_caracter, int id_source, int? id_user_verif)
{
this.Id = id_quote;
}
public int getId_quote()
{
return id_quote;
}
public string getContent() {
return content;
}
public int getLikes()
{
return likes;
}
public string getLangue()
{
return langue;
}
public bool getIsValide()
{
return isValide;
}
public string? getReason()
{
return reason;
}
public int getIdCaracter()
{
return id_caracter;
}
public int getIdSource()
{
return id_source;
}
public int? getIdUserVerif()
{
return id_user_verif;
}
}
}

@ -1,7 +1,19 @@
namespace WF_WebAdmin.Converter
using WF_WebAdmin.Model;
namespace WF_WebAdmin.Converter
{
public class QuoteExtension
{
public QuoteDTO QuoteToDTO(Quote q)
{
QuoteDTO quote = new QuoteDTO(q.Id, q.Content, q.Likes, q.Langue, q.IsValide, q.Reason, q.IdCaracter, q.IdSource, q.IdUserVerif);
return quote;
}
public Quote DTOToQuote(QuoteDTO q)
{
Quote quote = new Quote();
return quote;
}
}
}

@ -10,6 +10,19 @@
public string? Reason { get; set; }
public int IdCaracter { get; set; }
public int IdSource { get; set; }
public int IdUserVerif { get; set; }
public int? IdUserVerif { get; set; }
public Quote(int id, string content, int likes, string langue, bool isValide, string? reason, int idCaracter, int idSource, int idUserVerif)
{
Id = id;
Content = content;
Likes = likes;
Langue = langue;
IsValide = isValide;
Reason = reason;
IdCaracter = idCaracter;
IdSource = idSource;
IdUserVerif = idUserVerif;
}
}
}

Loading…
Cancel
Save