public static IEnumerable<Contest> GetAllContests()
{
using (SqlConnection connection = ConnectionManager.GetConnection())
{
var data = new ActivEarthDataProvidersDataContext(connection);
return (from c in data.ContestDataProviders
select
new Contest
{
ID = c.id,
Name = c.name,
Description = c.description,
Reward = c.reward,
StartTime = c.start,
EndValue =(float?)c.end_goal,
EndTime = c.end_time,
Mode = (ContestEndMode) c.end_mode,
Type = (ContestType) c.type,
StatisticBinding = (Statistic) c.statistic,
IsActive = c.active,
DeactivatedTime = c.deactivated,
CreatorId = c.creator_id
});
}
}