В веб-сервисе я пытаюсь преобразовать jzonString в список.
{
"name": "Test",
"Fname": "Testing",
"S1": "Content1",
"S2": "Content2",
"S3": "Content3"
}
[WebMethod]
public int Create(string Detils, string Companyid)
{
try
{
dynamic ScheduleShift = new JavaScriptSerializer().DeserializeObject(Detils);
\\ i need to set data to list or to an object
InvDetails objDetails = new InvDetails();
List<InvDetails> lstDetails = new List<InvDetails>();
return objDetails.CreateInvDetails(objDetils);
}
catch (Exception ex)
{
// Abort Transaction
throw ex;
}
}
Создан другой файл библиотеки, чтобы объявить объект и вставить в db
public class Inventory
{
CommonExecDAL CommonExecDAL = new CommonExecDAL();
public string name { get; set; }
public string Fname { get; set; }
public string S1 { get; set; }
public string S2 { get; set; }
public string S3 { get; set; }
public int intCompanyId { get; set; }
public int CreateInvComputer(InvDetails objInvDetails)
{
SqlParameter[] arParms = new SqlParameter[6];
.........
}
}