This is my code:
public MyResponse InsertTeam(MyRow Row)
{
try
{
var connection = SqlConnections.NewByKey("Cred");
/* Getting Insert to LogBook table */
TeamRow team = new TeamRow();
team.TeamId = TeamRow.Fields.TeamId;
var teamId = User.GetIdentifier();
team.CreatedBy = User.GetIdentifier();
team.CreatedOn = TimeZoneInfo.ConvertTime(DateTime.Now, TimeZoneInfo.FindSystemTimeZoneById("India Standard Time"));
}
catch
{ }
return new SaveResponse();
}
I get this error when running it:
Cannot implicitly convert type 'Serenity.Data.Int32Field' to 'int?'.
on this line:
team.TeamId = TeamRow.Fields.TeamId;
How should I clear this?
I think you are directly trying to assign the "Serenity.Data.Int32Field" to a nullable (int?) integer.... if you want so you can explicitly convert the "TeamRow.Fields.TeamId" part to a nullable int? using the value.
or you should check the docs for the Serenity framework, if they provide any explicit method to do so.