34 lines
867 B
C#
34 lines
867 B
C#
using OFBButte.Application.Database;
|
|
using OFBButte.Entities;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Text;
|
|
|
|
namespace OFBButte.Application.Missionary
|
|
{
|
|
public class AddMissionarySupportForm
|
|
{
|
|
private readonly IOFBContext context;
|
|
public AddMissionarySupportForm(IOFBContext context)
|
|
{
|
|
this.context = context;
|
|
}
|
|
|
|
public MissionarySupport Handle(MissionarySupport support)
|
|
{
|
|
support.Id = 0;
|
|
foreach (var child in support.Children)
|
|
{
|
|
child.Id = 0;
|
|
}
|
|
foreach(var school in support.CollegeRecommendations)
|
|
{
|
|
school.Id = 0;
|
|
}
|
|
context.MissionarySupportForms.Add(support);
|
|
context.SaveChanges();
|
|
return support;
|
|
}
|
|
}
|
|
}
|