Files
cms_thermo_active/Step.Model/DTOModels/MaintenanceModels/DTOMaintenanceNoteModel.cs
T
Lucio Maranta 81b4c60abd Added delete maintenance
GET/POST maintenance note API
2018-06-13 14:36:15 +02:00

37 lines
974 B
C#

using Step.Model.DatabaseModels;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
namespace Step.Model.DTOModels.MaintenanceModels
{
public class DTONewMaintenanceNoteModel
{
public string Message { get; set; }
}
public class DTOMaintenanceNoteModel : DTONewMaintenanceNoteModel
{
public int Id { get; set; }
public DateTime DateTime { get; set; }
public DTOMessageUserModel User { get; set; }
public static explicit operator DTOMaintenanceNoteModel(MaintenanceNoteModel note)
{
DTOMessageUserModel user = note.User != null ? (DTOMessageUserModel)note.User : null;
return new DTOMaintenanceNoteModel()
{
Id = note.Id,
DateTime = note.DateTime,
Message = note.Message,
User = user
};
}
}
}