2

I have the following query:

var query = _projectEmployeesBLL.GetAll()
    .Where(x => x.EmployeeID == employee.EmployeeID 
           && x.project.isActive == true 
           && x.project.isDelected == false)
    .Select(x => new
    {
        x.project.ProjectID,
        ProjeAdı = x.project.Name,
    });

The problem is that I make the property ProjeAdı in the Select clause. I want the property to match the sql column, Proje Adı (note the space). How can I do that?

gunr2171
  • 16,104
  • 25
  • 61
  • 88
Mehmet Avcı
  • 95
  • 1
  • 10

2 Answers2

4

while this might not be useful in your case, someone else looking for a way can use the 'DisplayName' attribute that can come in handy when enumerating properties as propertiesDescriptor. I had a similar requirement. here's how to use it-

[DisplayName("Father Name")]
public string FatherName{get;set;}

then access it using

propertyDescriptor.DisplayName

or byways shared here

Nakshtra
  • 94
  • 9
2

aliases cant have spaces between them , just like any variable name cant have white space, they are considered as bad naming conventions, you can use _(underscore) eg. Proje_Adi

James
  • 729
  • 6
  • 10