Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
VS 2013 can not evaluate expression
Message
 
 
À
06/08/2014 14:29:15
Information générale
Forum:
ASP.NET
Catégorie:
Problèmes
Versions des environnements
Environment:
C# 4.0
OS:
Windows 7
Network:
Windows 2003 Server
Database:
MS SQL Server
Application:
Web
Divers
Thread ID:
01605242
Message ID:
01605251
Vues:
50
RepositoryBase has this code
 public virtual T GetById(object id)
        {
            return _dbSet.Find(id);
        }
Do you know how to adjust these two calls:
 public PagedResult<Operator> GetOperators(QueryRequest queryRequest)
        {
            return _operatorRepository.GetPagedRequest(queryRequest);
        }

        public IEnumerable<Operator> GetAllOperators()
        {
            return _operatorRepository.GetAll();
        }
Do you know how to create a shorter object on the fly? The Operator object has lots of columns and I just want to return a few (in particular, OpCode, FirstName, LastName and Hidden)




>Not much to go on here. What's in base.GetById() ?
>
>
>>I am trying to debug a code from repository:
>>
>>
>>public override Operator GetById(object id)
>>        {
>>            var result = base.GetById(id);
>>            if (result == null)
>>                return result;
>>            HashOpCode(result);
>>            return result;
>>        }
>>
>>Unfortunately, in the locals window I see 'Could not evaluate expression' and same when I try to access properties of result in the immediate window.
>>
>>Is there a way to see the actual properties values? Why would I get this error? Could it be due to the var declaration?
>>
>>Thanks in advance.
>>
>>I also have another question - we're passing a string of OpCode as object and using base.GetById(id) method. In SQL Server profiler I'm seeing the following code
>>
>>
>>SELECT TOP (2) 
>>    [Extent1].[op_code] AS [op_code], 
>>...
>>where op_code = @p0'
>>
>>and @p0 is set to be varchar(8000) while the actual column is char(6). How can we make Entity Framework to use the actual type and length and why does it say select top (2)?
>>
>>Thanks in advance.
If it's not broken, fix it until it is.


My Blog
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform