Is there a way I can return a Guid with the code below? For example, what I'm passing in to AddSchedule is a class. I want to return an Id from the class so I can so something with it in the controller. How would I change my code to resolve this?
Controller
ModelService.AddSchedule(
new Schedule
{
Id = Guid.Empty,
Start = start,
Stop = end
});
What I want to do with the return Guid
ModelService.AddScheduleToPerson(
new Schedule
{
Id = ?, // get this from above
UserId = userid,
User = username
});
Model
public ObjectCreateStatus AddSchedule(Schedule schedule)
{
var client = new Services.ConfigurationClient();
try
{
ConfigurationMessage cMsg =
client.ConfigService.AddSchedule(
this.ControllerBase.SessionVariables.Credentials,
schedule
);
if (cMsg.Result == ConfigurationResultEnum.Success)
return ObjectCreateStatus.Success;
return ObjectCreateStatus.GeneralError;
}
finally
{
client.Close();
}
}