M
mesut
Hi Colleagues,
I return Lists in my linq querys when I need to return a lot of rows
and fields etc.
But this time I only want to return 1 field... Input is a name of
BusinessUnit and output should be BusinessUnitGuid. both are in a
table called tblCostCenter.
But I don't know how to return 1 field... Can someone help with the
syntax?
- I don't even want the container busGuid (result of projection). so
can someone send me #2 correct syntax one with busGuid container and
return busGuid and another one w/o.
- but should be in field in in ?????????
my linqtable is called. costcenter and full namespace is :
Linq.Costcenter
table
Linq.CostCenter
fields
BusinessUnit type String
BusinessUnitGuid type Guid
Description type String
etc. etc. etc.
- why can't I put as return type Linq.Costcenter.BusinessUnitGuid as
function result parameter????
thanks,
mesut
//GetCostCenter - INPUT: BusinessUnit OUTPUT: BusinessUnitGUID
public ???????? GetBusinessUnitGuid(string businessUnit)
{
//connection to the Linq
objDataContext = DatabaseFactory.GetLinqConnection();
var busGuid= (from CostCenter in
objDataContext.tblCostCenters
where CostCenter.BusinessUnit ==
businessUnit
select CostCenter.BusinessUnitGuid);
return busGuid;
}
I return Lists in my linq querys when I need to return a lot of rows
and fields etc.
But this time I only want to return 1 field... Input is a name of
BusinessUnit and output should be BusinessUnitGuid. both are in a
table called tblCostCenter.
But I don't know how to return 1 field... Can someone help with the
syntax?
- I don't even want the container busGuid (result of projection). so
can someone send me #2 correct syntax one with busGuid container and
return busGuid and another one w/o.
- but should be in field in in ?????????
my linqtable is called. costcenter and full namespace is :
Linq.Costcenter
table
Linq.CostCenter
fields
BusinessUnit type String
BusinessUnitGuid type Guid
Description type String
etc. etc. etc.
- why can't I put as return type Linq.Costcenter.BusinessUnitGuid as
function result parameter????
thanks,
mesut
//GetCostCenter - INPUT: BusinessUnit OUTPUT: BusinessUnitGUID
public ???????? GetBusinessUnitGuid(string businessUnit)
{
//connection to the Linq
objDataContext = DatabaseFactory.GetLinqConnection();
var busGuid= (from CostCenter in
objDataContext.tblCostCenters
where CostCenter.BusinessUnit ==
businessUnit
select CostCenter.BusinessUnitGuid);
return busGuid;
}