Форум программистов, компьютерный форум, киберфорум
C# .NET
Войти
Регистрация
Восстановить пароль
Карта форума Темы раздела Блоги Сообщество Поиск Заказать работу  
 
Рейтинг 4.89/9: Рейтинг темы: голосов - 9, средняя оценка - 4.89
38 / 38 / 12
Регистрация: 28.03.2013
Сообщений: 272
Записей в блоге: 2
1

Гибкая фильтрация данных запроса

13.02.2015, 14:21. Показов 1848. Ответов 14
Метки linq (Все метки)

Author24 — интернет-сервис помощи студентам
Требуется сделать фильтр таблицы. Фильтр большой около 15 различных типов полей (string, datetime, boolean). Как сделать подобный фильтр более гибким??? То есть если поле не задано пользователем (не вводились данные) то не включать его в запрос where.

Примерно вот так делаю:
C#
1
2
3
4
5
var db.Driver.Where(p => (String.IsNullOrEmpty(seria) || p.seria.IndexOf(seria) == 0) &&
                    (String.IsNullOrEmpty(numer) || p.NUMER.IndexOf(numer) == 0) &&
                    (date== null || p.date== date) &&
                    (active_doc == null || p.active_doc == active_doc) &&
                    (spr_null == null || p.spr_null== spr_null));
Если ввожу один параметр на форме почему поиск по одному параметру не происходит? как строить подобный запрос правильно???
0
Лучшие ответы (1)
Programming
Эксперт
94731 / 64177 / 26122
Регистрация: 12.04.2006
Сообщений: 116,782
13.02.2015, 14:21
Ответы с готовыми решениями:

Фильтрация данных
Здравствуйте, есть datagridview для вывода данных и два ComboBox с помощью которых требуется...

Фильтрация данных
Есть у меня две таблицы в БД: Sotrudniki (id_sotr(pk), id_ot(fk) name_sotr) -> Otdely (id_ot(pk),...

Гибкая последовательная сортировка
Всем привет! Столкнулся с проблемой, имеется таблица - Table3, с полями - Field1, Field2, Field3,...

Фильтрация данных из БД Access
Помогите пожалуйста с поиском и выводом данных в поле поиска вводим пин-код и вывести нужную...

14
2151 / 1288 / 516
Регистрация: 04.03.2014
Сообщений: 4,092
13.02.2015, 14:26 2
Цитата Сообщение от Trukhanov_VP Посмотреть сообщение
Как сделать подобный фильтр более гибким??? То есть если поле не задано пользователем
сделать столько Funcoв (предикатов) сколько есть фильтров
потом сформировать один итоговый Func в котором будут использоваться только те фильтры которые выбраны
и этот итоговый предикат пихать в linq to ef
0
38 / 38 / 12
Регистрация: 28.03.2013
Сообщений: 272
Записей в блоге: 2
13.02.2015, 14:35  [ТС] 3
Metall_Version, как сложить Funcии ?
0
2151 / 1288 / 516
Регистрация: 04.03.2014
Сообщений: 4,092
13.02.2015, 15:28 4
Лучший ответ Сообщение было отмечено Trukhanov_VP как решение

Решение

Trukhanov_VP, вот пример на пальцах
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
            List<Entity> list = new List<Entity>
            {
                new Entity {ID = 1, Name = "qwerty"},
                new Entity {ID = 2, Name = "rewyt"},
                new Entity {ID = 4, Name = "asdfg"},
            };
 
            int compareId = 2;  // ID для сравнения в фильтре
            string compareName = "qwerty";  // имя для сравнения в фильтре
 
 
            bool filterById = true,    // указывает нужно ли фильтровать по полю ID
                filterByName = false;   // указывает нужно ли фильтровать по полю Name
 
            Func<Entity, bool> predicateById = x => x.ID == compareId;
            Func<Entity, bool> predicateByName = x => x.Name == compareName;
 
            Func<Entity, bool> mainPredicate = x => (!filterById || predicateById(x))
                                                    && (!filterByName || predicateByName(x));
 
 
            foreach (var entity in list.Where(mainPredicate))
            {
                Console.WriteLine(entity);
            }
2
Master of Orion
Эксперт .NET
6098 / 4954 / 905
Регистрация: 10.07.2011
Сообщений: 14,522
Записей в блоге: 5
13.02.2015, 16:42 5
Скину код с прода, надеюсь, никто возражать у меня не будет (тем более, что писал я)
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
        private void FillData(IEnumerable<AuditEntry> source, Func<IEnumerable<AuditEntry>, IOrderedEnumerable<AuditEntry>> orderBy, int esimatedCount)
        {
            foreach (var pair in _filters)
            {
                string propName = pair.Key;
                string filter = pair.Value;
                if (!filter.IsEmpty() && propName != "UserId")
                {
                    esimatedCount /= 10;
                    source = source.WhereRegexIsMatch(filter, propName);
                }
            }
            string userIdFilter = _filters["UserId"];
            if (!userIdFilter.IsEmpty())
            {
                esimatedCount /= 10;
                source = FilterById(source, userIdFilter);
            }
 
            source = orderBy == null
                ? source.OrderByDescending(x => x.Occurred)
                : orderBy(source).ThenByDescending(x => x.Occurred);
 
            if (string.IsNullOrEmpty(deleteLogsTb.Text))
            {
                deleteLogsTb.Text = DateTime.Today.ToShortDateString();
            }
            FilterFromTb.Text = FromFilter.ToShortDateString();
            FilterToTb.Text = ToFilter.ToShortDateString();
 
            var result = source.ToListNoCopy(esimatedCount);
            EntriesCount = result.Count;
            AuditGridView.DataSource = result;
            DataBind();
        }
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
    public static IEnumerable<AuditEntry> WhereRegexIsMatch(this IEnumerable<AuditEntry> collection, string pattern, string property)
    {
        var regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        switch(property)
        {
            case "ItemId":          
                return collection.Where(x => regex.IsMatch(x.ItemId.ToString()));
            case "ItemType":            
                return collection.Where(x => regex.IsMatch(x.ItemType));
            case "DocLocation":             
                return collection.Where(x => regex.IsMatch(x.DocLocation));
            case "Event":           
                return collection.Where(x => regex.IsMatch(x.Event));
            case "UserId":          
                return collection.Where(x => regex.IsMatch(x.UserId.ToString()));
            case "Occurred":            
                return collection.Where(x => regex.IsMatch(x.Occurred.ToString()));
            }          
        throw new NotImplementedException();
    }
1
burning1ife
1462 / 1284 / 293
Регистрация: 21.09.2008
Сообщений: 3,438
Записей в блоге: 9
15.02.2015, 10:16 6
Еще добавлю к способу Metall_Version, что для построения цепочек предикатов можно использовать LinqKit
1
38 / 38 / 12
Регистрация: 28.03.2013
Сообщений: 272
Записей в блоге: 2
16.02.2015, 08:57  [ТС] 7
Metall_Version, из примера:
Цитата Сообщение от Metall_Version Посмотреть сообщение
C#
1
2
bool filterById = true, // указывает нужно ли фильтровать по полю ID 
filterByName = false; // указывает нужно ли фильтровать по полю Name
вместо этих параметров можно и проверку на NULL
0
Master of Orion
Эксперт .NET
6098 / 4954 / 905
Регистрация: 10.07.2011
Сообщений: 14,522
Записей в блоге: 5
16.02.2015, 10:09 8
Trukhanov_VP, да, кстати, надеюсь вы не подумали, что я всё для этих свойств расписывал руками, конечно же, это сгенерированный кусок кода
C#
1
2
3
4
5
6
7
8
9
10
11
12
    public static IEnumerable<AuditEntry> WhereRegexIsMatch(this IEnumerable<AuditEntry> collection, string pattern, string property)
    {
        var regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        switch(property)
        {
            <# foreach (var prop in props) {
            #>case "<#=prop.Name#>":            
                return collection.Where(x => regex.IsMatch(x.<#= prop.Name + (prop.PropertyType == typeof (string) ? "" : ".ToString()")#>));
            <# } 
        #>}          
        throw new NotImplementedException();
    }
3
584 / 371 / 63
Регистрация: 22.07.2009
Сообщений: 875
Записей в блоге: 4
16.02.2015, 12:24 9
Цитата Сообщение от Psilon Посмотреть сообщение
конечно же, это сгенерированный кусок кода
Вау! А можно поподробней узнать, каким образом Вы осуществляли данную кодогенерацию? (что это за инструмент? - где о нем прочитать?)
0
Master of Orion
Эксперт .NET
6098 / 4954 / 905
Регистрация: 10.07.2011
Сообщений: 14,522
Записей в блоге: 5
16.02.2015, 13:16 10
sigmov, Да это не секрет, гуглите по T4 template Например

Добавлено через 40 минут
Очень мощная штука. В моем случае вот ЭТО
Кликните здесь для просмотра всего текста
<#@ template language="C#" #>
<#@ output extension=".cs" #>
<#@ assembly name="System.Core" #>
<#@ assembly name="System.Reflection" #>
<#@ assembly name="$(TargetDir)$(TargetFileName)"

#>using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.UI.WebControls;
using Lanit.Audit.Models;

<#var props = typeof (Lanit.Audit.Models.AuditEntry).GetProperties(System.Reflection.BindingFlags.Ins tance | System.Reflection.BindingFlags.Public); #>

public static class AuditHelper
{
public static IOrderedEnumerable<AuditEntry> OrderBy(this IEnumerable<AuditEntry> collection, string property)
{
switch(property)
{
<# foreach (var prop in props) {
#>case "<#=prop.Name#>":
return collection.OrderBy(x=>x.<#=prop.Name#>);
<# }
#>}
throw new NotImplementedException();
}

public static IOrderedEnumerable<AuditEntry> OrderByDescending(this IEnumerable<AuditEntry> collection, string property)
{
switch(property)
{
<# foreach (var prop in props) {
#>case "<#=prop.Name#>":
return collection.OrderByDescending(x=>x.<#=prop.Name#>);
<# }
#>}
throw new NotImplementedException();
}

public static IOrderedEnumerable<AuditEntry> OrderBy(this IEnumerable<AuditEntry> collection, string property, SortDirection directon)
{
return directon == SortDirection.Ascending ? collection.OrderBy(property) : collection.OrderByDescending(property);
}

public static IComparer<AuditEntry> GetComparer(string property, SortDirection directon)
{
switch(property)
{
<#foreach (var prop in props) {
#>case "<#=prop.Name#>":
return directon == SortDirection.Ascending ? (IComparer<AuditEntry>) new <#=prop.Name#>Comparer() : new <#=prop.Name#>ComparerDescendant();
<# }
#>}
throw new NotImplementedException();
}

public static bool RegexIsMatch(this AuditEntry entry, string pattern, string property)
{
var regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
switch(property)
{
<# foreach (var prop in props) {
#>case "<#=prop.Name#>":
return regex.IsMatch(entry.<#= prop.Name + (prop.PropertyType == typeof (string) ? "" : ".ToString()")#>);
<# }
#>}
throw new NotImplementedException();
}

public static IEnumerable<AuditEntry> WhereRegexIsMatch(this IEnumerable<AuditEntry> collection, string pattern, string property)
{
var regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
switch(property)
{
<# foreach (var prop in props) {
#>case "<#=prop.Name#>":
return collection.Where(x => regex.IsMatch(x.<#= prop.Name + (prop.PropertyType == typeof (string) ? "" : ".ToString()")#>));
<# }
#>}
throw new NotImplementedException();
}
}


<# foreach (var prop in props) { #>

public class <#=prop.Name#>Comparer : IComparer<AuditEntry>
{
public int Compare(AuditEntry x, AuditEntry y)
{
return x.<#=prop.Name#>.CompareTo(y.<#=prop.Name#>);
}
}

public class <#=prop.Name#>ComparerDescendant : IComparer<AuditEntry>
{
public int Compare(AuditEntry x, AuditEntry y)
{
return y.<#=prop.Name#>.CompareTo(x.<#=prop.Name#>);
}
}

<# } #>


превращается в
Кликните здесь для просмотра всего текста
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
using System;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text.RegularExpressions;
using System.Web.UI.WebControls;
using Lanit.Audit.Models;
 
 
public static class AuditHelper
{
    public static IOrderedEnumerable<AuditEntry> OrderBy(this IEnumerable<AuditEntry> collection, string property)
    {   
        switch(property)
        {
            case "ItemId":          
                return collection.OrderBy(x=>x.ItemId);
            case "ItemType":            
                return collection.OrderBy(x=>x.ItemType);
            case "DocLocation":             
                return collection.OrderBy(x=>x.DocLocation);
            case "Event":           
                return collection.OrderBy(x=>x.Event);
            case "UserId":          
                return collection.OrderBy(x=>x.UserId);
            case "Occurred":            
                return collection.OrderBy(x=>x.Occurred);
            }
        throw new NotImplementedException();
    }
 
    public static IOrderedEnumerable<AuditEntry> OrderByDescending(this IEnumerable<AuditEntry> collection, string property)
    {  
        switch(property)
        {
            case "ItemId":          
                return collection.OrderByDescending(x=>x.ItemId);
            case "ItemType":            
                return collection.OrderByDescending(x=>x.ItemType);
            case "DocLocation":             
                return collection.OrderByDescending(x=>x.DocLocation);
            case "Event":           
                return collection.OrderByDescending(x=>x.Event);
            case "UserId":          
                return collection.OrderByDescending(x=>x.UserId);
            case "Occurred":            
                return collection.OrderByDescending(x=>x.Occurred);
            }
        throw new NotImplementedException();
    }
 
    public static IOrderedEnumerable<AuditEntry> OrderBy(this IEnumerable<AuditEntry> collection, string property, SortDirection directon)
    {
      return directon == SortDirection.Ascending ? collection.OrderBy(property) : collection.OrderByDescending(property); 
    }
 
    public static IComparer<AuditEntry> GetComparer(string property, SortDirection directon)
    {
      switch(property)
      {
         case "ItemId":
            return directon == SortDirection.Ascending ? (IComparer<AuditEntry>) new ItemIdComparer() : new ItemIdComparerDescendant();   
         case "ItemType":
            return directon == SortDirection.Ascending ? (IComparer<AuditEntry>) new ItemTypeComparer() : new ItemTypeComparerDescendant();   
         case "DocLocation":
            return directon == SortDirection.Ascending ? (IComparer<AuditEntry>) new DocLocationComparer() : new DocLocationComparerDescendant();   
         case "Event":
            return directon == SortDirection.Ascending ? (IComparer<AuditEntry>) new EventComparer() : new EventComparerDescendant();   
         case "UserId":
            return directon == SortDirection.Ascending ? (IComparer<AuditEntry>) new UserIdComparer() : new UserIdComparerDescendant();   
         case "Occurred":
            return directon == SortDirection.Ascending ? (IComparer<AuditEntry>) new OccurredComparer() : new OccurredComparerDescendant();   
         }
        throw new NotImplementedException();
    }
 
    public static bool RegexIsMatch(this AuditEntry entry, string pattern, string property)
    {
        var regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        switch(property)
        {
            case "ItemId":          
                return regex.IsMatch(entry.ItemId.ToString());
            case "ItemType":            
                return regex.IsMatch(entry.ItemType);
            case "DocLocation":             
                return regex.IsMatch(entry.DocLocation);
            case "Event":           
                return regex.IsMatch(entry.Event);
            case "UserId":          
                return regex.IsMatch(entry.UserId.ToString());
            case "Occurred":            
                return regex.IsMatch(entry.Occurred.ToString());
            }        
        throw new NotImplementedException();
    }
 
    public static IEnumerable<AuditEntry> WhereRegexIsMatch(this IEnumerable<AuditEntry> collection, string pattern, string property)
    {
        var regex = new Regex(pattern, RegexOptions.IgnoreCase | RegexOptions.Compiled);
        switch(property)
        {
            case "ItemId":          
                return collection.Where(x => regex.IsMatch(x.ItemId.ToString()));
            case "ItemType":            
                return collection.Where(x => regex.IsMatch(x.ItemType));
            case "DocLocation":             
                return collection.Where(x => regex.IsMatch(x.DocLocation));
            case "Event":           
                return collection.Where(x => regex.IsMatch(x.Event));
            case "UserId":          
                return collection.Where(x => regex.IsMatch(x.UserId.ToString()));
            case "Occurred":            
                return collection.Where(x => regex.IsMatch(x.Occurred.ToString()));
            }          
        throw new NotImplementedException();
    }
}
 
 
 
public class ItemIdComparer : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return x.ItemId.CompareTo(y.ItemId);
    }
}
 
public class ItemIdComparerDescendant : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return y.ItemId.CompareTo(x.ItemId);
    }
}
 
 
public class ItemTypeComparer : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return x.ItemType.CompareTo(y.ItemType);
    }
}
 
public class ItemTypeComparerDescendant : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return y.ItemType.CompareTo(x.ItemType);
    }
}
 
 
public class DocLocationComparer : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return x.DocLocation.CompareTo(y.DocLocation);
    }
}
 
public class DocLocationComparerDescendant : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return y.DocLocation.CompareTo(x.DocLocation);
    }
}
 
 
public class EventComparer : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return x.Event.CompareTo(y.Event);
    }
}
 
public class EventComparerDescendant : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return y.Event.CompareTo(x.Event);
    }
}
 
 
public class UserIdComparer : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return x.UserId.CompareTo(y.UserId);
    }
}
 
public class UserIdComparerDescendant : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return y.UserId.CompareTo(x.UserId);
    }
}
 
 
public class OccurredComparer : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return x.Occurred.CompareTo(y.Occurred);
    }
}
 
public class OccurredComparerDescendant : IComparer<AuditEntry>
{
    public int Compare(AuditEntry x, AuditEntry y)
    {
        return y.Occurred.CompareTo(x.Occurred);
    }
}


Мне норм
1
38 / 38 / 12
Регистрация: 28.03.2013
Сообщений: 272
Записей в блоге: 2
16.02.2015, 13:59  [ТС] 11
Psilon, я сделал все проще. Почитал тут тему и воспользовавшись примером Metall_Version написал так:
C#
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
public class SPR_DRIVERSearch : FilterModel<SPR_DRIVER>
{
// поля для поиска...
public override Func<SPR_DRIVER, bool> FilterExpression
        {
            get
            {
                DateTime StartDate = new DateTime(1900, 1, 1, 0, 0, 0);
 
                Func<SPR_DRIVER, bool> active = p => ((ACTIVE_DOC == null || ACTIVE_DOC == false) || p.ACTIVE_DOC == ACTIVE_DOC);
 
                Func<SPR_DRIVER, bool> spr_null = p => ((SPR_NULL == null || SPR_NULL == false) || p.SPR_NULL == SPR_NULL);
 
                Func<SPR_DRIVER, bool> seria = p => (String.IsNullOrEmpty(SERIA) || p.SERIA.Contains(SERIA));
 
                Func<SPR_DRIVER, bool> numer = p => (String.IsNullOrEmpty(NUMER) || p.NUMER.Contains(NUMER));
 
                Func<SPR_DRIVER, bool> date = p => ((DATE == null || DATE < StartDate) || p.DATE == DATE);
 
                Func<SPR_DRIVER, bool> fam = p => (String.IsNullOrEmpty(SPR_FAM) || p.SPR_FAM.Contains(SPR_FAM));
 
                Func<SPR_DRIVER, bool> im = p => (String.IsNullOrEmpty(SPR_IM) || p.SPR_IM.Contains(SPR_IM));
 
                Func<SPR_DRIVER, bool> ot = p => (String.IsNullOrEmpty(SPR_OT) || p.SPR_OT.Contains(SPR_OT));
 
                Func<SPR_DRIVER, bool> dr = p => ((SPR_DR == null || SPR_DR < StartDate) || p.SPR_DR == SPR_DR);
 
                Func<SPR_DRIVER, bool> sdoc = p => (String.IsNullOrEmpty(SPR_S_DOC) || p.SPR_S_DOC.Contains(SPR_S_DOC));
 
                Func<SPR_DRIVER, bool> ndoc = p => (String.IsNullOrEmpty(SPR_N_DOC) || p.SPR_N_DOC.Contains(SPR_N_DOC));
 
                Func<SPR_DRIVER, bool> ddoc = p => ((SPR_DATA_DOC == null || SPR_DATA_DOC < StartDate) || p.SPR_DATA_DOC == SPR_DATA_DOC);
                
                Func<SPR_DRIVER, bool> vdoc = p => (String.IsNullOrEmpty(SPR_VID_DOC) || p.SPR_VID_DOC.Contains(SPR_VID_DOC));
 
                return p => active(p) && spr_null(p) && 
                    seria(p) && numer(p) && date(p) && 
                    fam(p) && im(p) && ot(p) && dr(p) &&
                    sdoc(p) && ndoc(p) && ddoc(p) && vdoc(p);
          }
    }
}
во время запроса:
C#
1
2
var drivers = db.SPR_DRIVER.Where(model.FilterExpression);
return PartialView(drivers);
Получился довольно гибкий фильтр, что и требовалось!!!
0
burning1ife
1462 / 1284 / 293
Регистрация: 21.09.2008
Сообщений: 3,438
Записей в блоге: 9
16.02.2015, 14:04 12
Я еще использую Code Templates из Resharper'a
0
Master of Orion
Эксперт .NET
6098 / 4954 / 905
Регистрация: 10.07.2011
Сообщений: 14,522
Записей в блоге: 5
16.02.2015, 14:11 13
kenny69, это скорее как сниппеты удобно. А тут нативная поддержка студии, да и компилится оно один раз и до переделки, причем автоматом. Сниппеты удобно, когда пишешь inpc, а он тебе реализует полностью INotifyPropertyChanged автоматом. Короче, разные цели

Trukhanov_VP, боюсь представить производительность этого чуда.
0
burning1ife
1462 / 1284 / 293
Регистрация: 21.09.2008
Сообщений: 3,438
Записей в блоге: 9
16.02.2015, 15:08 14
Psilon, согласен, я просто показал чем еще можно воспользоваться для автоматизации рутинных операций. А так да, задачи у них разные.
0
38 / 38 / 12
Регистрация: 28.03.2013
Сообщений: 272
Записей в блоге: 2
16.02.2015, 15:22  [ТС] 15
Psilon,
Цитата Сообщение от Psilon Посмотреть сообщение
гуглите по T4 template Например
Спасибо, добавлю в закладки
0
16.02.2015, 15:22
IT_Exp
Эксперт
87844 / 49110 / 22898
Регистрация: 17.06.2006
Сообщений: 92,604
16.02.2015, 15:22
Помогаю со студенческими работами здесь

Фильтрация выводимых в datagridview данных
Здравствуйте. Есть два datagridview, связанные по полю ID. Во тором gride есть колонка содержащая...

Динамичная фильтрация данных из списка
Здравствуйте. Нашел на форуме интересный метод фильтрации списка данных для textbox. Подскажите,...

Фильтрация данных в зависимости от выбора в ComboBox
Помогите организовать поиск(фильтрацию)во второй вкладке Combobox результат вывести в...

Фильтрация данных через BindingSource.Filter
Необходимо произвести поиск сразу по нескольким столбцам типа int и string. Данный запрос работает...


Искать еще темы с ответами

Или воспользуйтесь поиском по форуму:
15
Ответ Создать тему
КиберФорум - форум программистов, компьютерный форум, программирование
Powered by vBulletin
Copyright ©2000 - 2024, CyberForum.ru