简体   繁体   中英

How map a biginit inside entity framework, and how to convert a string into biginit

I have a field named assetid inside sql server with type Biginit.so how I can map this field inside entity framework, and convert a string to biginit. The biginit will be received as an XML string value such as:-

<operation> 
<operationstatus>Success</operationstatus> 
<resourcename>serverrr090909</resourcename> 
<assetid>2701</assetid> 
<message>Rack serverrr090909 added successfully</message> 
</operation>

So I am trying to write something such as :-

Var assetid =  message = doc.SelectSingleNode("/operation/message").InnerText;
// so how I can convert the string into biginit 

update

I wrote the following :-

    public void InsertOrUpdateRack(Rack rack,string username,long assetid)
            {       
//code goes here
    IT360ID = assetid,
                        }

but it raised the folloiwng error on IT360ID = assetid ,Cannot implicitly convert type 'long' to 'int?'. An explicit conversion exists (are you missing a cast?). so how i can assign an int? field a long value?

只需使用一个long Int64 (与Int64相同):

long assetid = long.Parse(doc.SelectSingleNode("/operation/assetid").InnerText);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM