I have method to get all values from database
Here is code
public IQueryable<TimeTable> GetTimeTables()
{
return db.TimeTables;
}
Here is model of TimeTable
public partial class TimeTable
{
public int Id { get; set; }
public string Company { get; set; }
public string INN { get; set; }
public string StartDay { get; set; }
public string StartPause { get; set; }
public string EndDay { get; set; }
public string EndPause { get; set; }
}
I need to generate xml from values like this
<data>
<worker id="000000000000">
<start>2016-08-08T08:00:00</start>
<pause>2016-08-08T13:15:49</pause>
<continue>2016-08-08T13:15:49</continue>
<end>2016-08-08T13:15:49</end>
</worker>
<worker id="000000000001">
<start>2016-08-08T08:00:00</start>
<pause>2016-08-08T13:15:49</pause>
<continue>2016-08-08T13:15:49</continue>
<end>2016-08-08T13:15:49</end>
</worker>
Where id
is INN, start
is StartDay, pause
is StartPause, continue
is EndPause, end
is EndDay.
How I can do this?