Home > Software engineering >  How to use an interface to add more data at the same time
How to use an interface to add more data at the same time

Time:11-22

Description: whether there this id to query the database table first step, didn't add this id, still need to add more data
Question: I this after parameter, skip, only to return out
` ` `

` ` ` public IHttpActionResult SetApproval (string rgl_kind_id, int select)
{
Var outPut=new OutInput ();
Var FDBD=db. Flowdefine. Where (x=& gt; X.r gl_kind_id==rgl_kind_id). ToList ();
If (FDBD==null)//if there is no this rglkindid field is net list add
{
Flowdefine FLDB=new flowdefine ();

FLDB. Rgl_lcmc="of" the first step;
FLDB. Rgl_step=1;
FLDB. Rgl_kind_id=rgl_kind_id;
FLDB. Isdelete=1;

FLDB. Rgl_lcmc="part ii";
FLDB. Rgl_step=2;
FLDB. Rgl_kind_id=rgl_kind_id;
FLDB. Isdelete=1;

FLDB. Rgl_lcmc="third";
FLDB. Rgl_step=3;
FLDB. Rgl_kind_id=rgl_kind_id;
FLDB. Isdelete=1;

FLDB. Rgl_lcmc="fourth";
FLDB. Rgl_step=4;
FLDB. Rgl_kind_id=rgl_kind_id;
FLDB. Isdelete=1;
Db. Flowdefine. Add (FLDB);
//save data stored in hard disk
The db. The Configuration. ValidateOnSaveEnabled=false;
Var result=the SaveChanges ();
The db. The Configuration. ValidateOnSaveEnabled=true;
//if data operation success
If (result & gt; 0)
{
//data structure
The outPut. ResultStatus="200";
The outPut. The MSG="execution success";
The outPut. The resultData="https://bbs.csdn.net/topics/1";
}
The else
{
The outPut. ResultStatus="201";
The outPut. The MSG="failure";
The outPut. The resultData=https://bbs.csdn.net/topics/new Dictionary ();
}
}

/* * * * * */business logic code
Return Ok (the outPut);
` ` `}
  • Related