How to get xml column in PetaPoco

I used the data type nvarcharin sql (msql-server) to describe the description. But instead, I would like to change the column to a data type xml. In my C # datalayer, I use petapoco to get data using Ado.Net DataReader.

So

poco object:

[PetaPoco.TableName("sqlTableName")]
[PetaPoco.PrimaryKey("ID")]
public class PlainObj
{
    public int ID { get; set; } //(int, not null)
    public string Description { get; set; } //(string, null) want to change this to xml type
}

poco get method

   public static List<PlainObj> Get(int InId)
    {
        var s = PetaPoco.Sql.Builder.Append(";EXEC @0", Common.StoreProcs.GetSP);
        s.Append("@@ID = @0", new SqlParameter() { SqlDbType = SqlDbType.Int, Value = InId });

        return PetaPocoContext.Fetch<PlainObj>(s); //Gets the object 
    }

My question is how do I get XML instead of a description string, and supports PetaPoco.

+4
source share
1 answer

, Petapoco XML , XML SQL Server poco , - linq xml xDocument xml . , xmlDocument (Petapoco.Igrnored) poco ( , , t4) xml xml getters/seters, XML. , / xml, Petapoco , .

+4

All Articles