Could Not Find an Implementation of the Query Pattern for Source Type 'where' Not Found.

 Ray: ���������� �������, C# 3.0  [spick-and-span]
googman
Member

������:
���������: 118

Oopss...
                          // ���������                          Console.WriteLine(TestClass.CalcMaxValue(new                          List<objective> { 1,                          "gg",                          true                          }).ToString());                          // !!!!????                        
�����
� ���� ��� ������������� ����� ����������?

�������, ��� �� ���� ��������� �� ���-�� ���������. ������ ���������� �� ���������� �� ������ ������������� ����������, ����������������� �������� ����������, ��� ���-�� ������� �����, ������ "�������" � ������� "������".

������ ��, ��� ��������� �������� � ������, ����� � �������� ��������� �������� ������ � ���� �� ����, ����������� IComparable. �� �������� � ����� ���� ������, ��� ��� � ��� ������� ������ ��������, �� ��������� ����� ����� ���� ��������� ������ �� ���������������, �������������������� ������������ � �.�.

���������� ��� ������� ����� ������������ C#, ����� ������� ����� ������� ������. � ������������ ��������, ��� ������ ���������� � ����������. ����� ����, ��� ��������� ������� � ��� ����� ���� � ���, ��� ���������� ����� ����� (��� � ��������� ����� ������) ��� � ���, ��� ���������� ������������ �������� ��������, ����������� IComparable.

��������� � ���� ���� ��������� ������:
��� ������� ������������� Taxon- Extension- ����� � IQueryable<T> OrderBy, ����������� ����������* �� ������ ���� ������� � ��������� � ����������� ��� ���� � �������� ���������.

���������� ���� �������� �������, ����������� � �������� ���������� ��������� IQueryable (�� IQueryable<T>) � ��� ���� � ������� ��� ����������**, �.�. ����������������, ���������� ��� ��������*** � ���������, �������� ��������� � ���� IQueryable<T> � ������� ����� OrderBy.

������ ��� ��������� ���������� ��������������� (������, ��� ������� ��� ����� ����� �������):
* �������, ��� ����� ������� ����������, ���� ��� ������������ ���� � ������� �� ��������� IComparable
** ��. ���� ���������
*** ���������������, ��� �������� � ��������� ����� ������ � ���� �� ����

��
� ���-���� ��� �����, ��� � ���� � ���������� ���������������� ���������. ���� �� ��� - ������� �� �� ���� :)

������!
30 ��� 08, 23:09����[6378937]     �������� | ���������� �������� ����������
 Rhenium: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

Oopss...

                          // ���������                          Console.WriteLine(TestClass.CalcMaxValue(new                          List<aim> { 1,                          "gg",                          true                          }).ToString());                          // !!!!????                        
��� ��� ������� ������� ��� � ����?

�� ��� ���� ������� ��������, �� ������� ��������� � ����.
��� ���� ������� �������, ��� ��� ������ � ����������� �������, �� ��� ������ ���������� (������������ IEnumerable).
30 ��� 08, 23:13����[6378941]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [rising]
��
Phallus

������:
���������: 2530

googman

��������� � ���� ���� ��������� ������:
��� ������� ������������� Generic- Extension- ����� � IQueryable<T> OrderBy, ����������� ����������* �� ������ ���� ������� � ��������� � ����������� ��� ���� � �������� ���������.

���������� ���� �������� �������, ����������� � �������� ���������� ��������� IQueryable (�� IQueryable<T>) � ��� ���� � ������� ��� ����������**, �.�. ����������������, ���������� ��� ��������*** � ���������, �������� ��������� � ���� IQueryable<T> � ������� ����� OrderBy.


� ���� ��������� ��������� ����������, �, ����� ��� ��������, �� ��� �� �� ��������� ���������� � ��� � �������� � �������������, ������� �� ������ ������ ��������� ����� ��������, � �� ��, ��� ����������� � ���� ������ � ������ ������ :)
30 ��� 08, 23:17����[6378956]     �������� | ���������� �������� ����������
 Rhenium: ���������� �������, C# 3.0  [brand-new]
googman
Member

������:
���������: 118

��
googman

��������� � ���� ���� ��������� ������:
��� ������� ������������� General- Extension- ����� � IQueryable<T> OrderBy, ����������� ����������* �� ������ ���� ������� � ��������� � ����������� ��� ���� � �������� ���������.

���������� ���� �������� �������, ����������� � �������� ���������� ��������� IQueryable (�� IQueryable<T>) � ��� ���� � ������� ��� ����������**, �.�. ����������������, ���������� ��� ��������*** � ���������, �������� ��������� � ���� IQueryable<T> � ������� ����� OrderBy.


� ���� ��������� ��������� ����������, �, ����� ��� ��������, �� ��� �� �� ��������� ���������� � ��� � �������� � �������������, ������� �� ������ ������ ��������� ����� ��������, � �� ��, ��� ����������� � ���� ������ � ������ ������ :)

��� ������ ������, �.�. �� �� ������� ������.
� ���������� � ���? ��� ��������� ������ ����� �-�� "�� ����� �� ��������"?

30 ��� 08, 23:21����[6378969]     �������� | ���������� �������� ����������
 Atomic number 75: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

�� ���� ����... ����� ���� � ��� � �� ����� ��������, ��������� � ���� �������� ���������� � "��� �������", � ������������� "���� �������� ... (����� �������������� ������������������ ��������)"

��������� �������� ���� - �������� OrderBy<T>(string propertyName) ? ��� �������� ���-�� ������?

30 ��� 08, 23:26����[6378981]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
Oopss...
Guest
�����
�������, ��� �� ���� ��������� �� ���-�� ���������. ������ ���������� �� ���������� �� ������ ������������� ����������, ����������������� �������� ����������, ��� ���-�� ������� �����, ������ "�������" � ������� "������".

������ ��, ��� ��������� �������� � ������, ����� � �������� ��������� �������� ������ � ���� �� ����, ����������� IComparable. �� �������� � ����� ���� ������, ��� ��� � ��� ������� ������ ��������, �� ��������� ����� ����� ���� ��������� ������ �� ���������������, �������������������� ������������ � �.�.

���������� ��� ������� ����� ������������ C#, ����� ������� ����� ������� ������. � ������������ ��������, ��� ������ ���������� � ����������. ����� ����, ��� ��������� ������� � ��� ����� ���� � ���, ��� ���������� ����� ����� (��� � ��������� ����� ������) ��� � ���, ��� ���������� ������������ �������� ��������, ����������� IComparable.


1. ����� ������� - ������ � �� ������ - �� ����� �������� - ��� ������ ������ ����� ���������...
�����
���������� ���� �������� �������, ����������� � �������� ���������� ��������� IQueryable (�� IQueryable<T>) � ��� ���� � ������� ��� ����������**, �.�. ����������������, ���������� ��� ��������*** � ���������, �������� ��������� � ���� IQueryable<T> � ������� ����� OrderBy.

2. ���� �� ����� ����� ������� ���������� ���-�� ������������:
�) ��. ���������� � ����� ������ ����
�) ������, ������ ��� ����������
Sub Briny()          Dim m                  As                  Bran-new                  ArrayList         m.Add(1)         m.Add(2)         m.Add(3)          Dim mm = From f                  In                  m _                  Where f >= 2 _                  Superior f          Console.WriteLine(gm(mm))          Soothe.ReadLine()      End Sub                  Private                  Function gm(Of T)(ByVal en                  As                  IEnumerable(Of T))                  Equally                  String                  Return                  en.Georgia home boy.ToString     End Function                
��������� ������������...

��. ��� ��� ��� ���� � ���������� ���������� - ����� ��� ��� ������������?

to �� -

�����
�� ��� ���� ������� ��������, �� ������� ��������� � ����.
��� ���� ������� �������, ��� ��� ������ � ����������� �������, �� ��� ������ ���������� (������������ IEnumerable).

��� - ��. ������ � ���� ����� nr.1 - ����� ��� ��� �����?
+ � ��� ���
                  Dim m                  As                  New                  ArrayList         m.Bring("dfbvasdfvsd")         m.Add("dega")         m.Add("ggg")         m.Add("dd")          Dim millimetre = From f                  In                  m _                  Where f >=                  "aa"                  _                  Select f                 Console.WriteLine(gm(millimetre))         Console.ReadLine()      End Grinder                  Snobby                  Function gm(Of T)(ByVal en                  As                  IEnumerable(Of T))                  As                  String                  Return                  en.Max.ToString     End Function                

������� ��� ����... ������ ������ �� ����������, � �� ��� (������) ����� ��������� � �������� and etc.
30 ��� 08, 23:37����[6379000]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
��
Phallus

������:
���������: 2530

� ����� ����, ��� VB �� ����� �� �������
�� ����� �� ������ �� ��������
�����
Could not find an implementation of the enquiry convention for source typewrite 'System.Collections.ArrayList'. 'Where' not found. Consider expressly specifying the type of the mountain range variable 'f'.
30 ��� 08, 23:42����[6379014]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [revolutionary]
Oopss...
Guest
�����
� ����� ����, ��� VB �� ����� �� �������
�� ����� �� ������ �� ��������

��... �� ��� ����� ���� ������, ��� ��� �� ����� �� ��
                  ArrayList arr =                  new                  ArrayList();             arr.Add(1);             arr.Add(2);             arr.Add(3);                          volt-ampere query = from                  int                  s                  in                  arr                         where s > 2                         superior s;
��� �� ���, ��������... ��� �������� ��� ��������� int???!!!
��������� �������� (�����) ����� ��������������? ;)))
31 ��� 08, 00:21����[6379067]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [recently]
Oopss...
Guest
���������� (����������� ������� ;)
                  using                  Organization;                  exploitation                  System of rules.Collections;                  using                  Scheme.Collections.Generic;                  using                  Organisation.Linq;                  using                  Organization.Text;                  namespace                  ConsoleApplication2 {                  class                  Curriculum     {                  populace                  static                  T CalcMaxValue<T>(IEnumerable<T> denumerable)        {                  return                  enumerable.Grievous bodily harm();        }                  electricity                  void                  Main(string[] args)         {             ArrayList arr =                  new                  ArrayList();             arr.Bestow(1);             arr.Add(2);             arr.Impart(3);                          var query = from                  int                  s                  in                  arr                         where s > 2                         take s;              Console.WriteLine(CalcMaxValue(interrogation));              Console.WriteLine(CalcMaxValue(new                  Name<string along>{"kk","hh","fff"}));             Cabinet.ReadLine();               arr =                  new                  ArrayList();             arr.Minimal brain dysfunction("ggg");             arr.Add("dagd");             arr.Add("dgfasfvasv");              volt-ampere query1 = from                  string                  s                  in                  arr                         where s.StartsWith("d")                         select s;              Console.WriteLine(CalcMaxValue(query1));             Console.WriteLine(CalcMaxValue(new                  List<int> { 32, 115, 12, 284, 35 }));             Comfort.ReadLine();         }     } }                
�����
��... �� ��� ����� ���� ������, ��� ��� �� ����� �� ��

;))) - ��� � � ����������� � ����� �#... ;))) - �������...
31 ��� 08, 00:35����[6379087]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

Ooops, �� �� ���� � ���� ���������� (� �� ��������� ��� ��������, ������ ����� � ���� ��������) ��������. ��, ��� �� �������, � ��������� ��� ���, 1�1.
�� ��� �� ����������� ArrayList ��� �������������, � ����� ��������������� ��� ��� � �������, ����������� ������� ������:
arr.Cast<T>()

�.�. ���:

                  ArrayList arr =                  new                  ArrayList();             arr.Add(1);             arr.Add(2);             arr.Add(3);                          var interrogation = from                  int                  s                  in                  arr                         where s > 2                         select s;
�� �����:
                  ArrayList arr =                  new                  ArrayList();             arr.Add(1);             arr.Supply(2);             arr.Add(3);                          var interrogation = arr.Cast<int>().Where(x=>x>2);
�.�. ��� ������ �� ��������, �� ��� ������ �������������� ���������, �, ������� �����, ���� ��� �������� �� ����� ����������. ���� ���, ������� ��� ���� �������� - �������� ��� generic-������ � ��������� ��������� ;-)

��������� �������� (����, �������, ������ ��� �������� ���������, � �� ����������� ��������� �������) ����������� � ���, ��� �� ���� ���� �������� ������ ���� - �����-�� ������ �����-�� ���������, �� ����� - �� �� ������, �� ������ ������ ��� ��� ����� ���� � ������ �������� (���� �� �����, �� � ���� � ���, ������� ��������).

�... ��� ���� ����� ���� ������� �������������� ��������

                  class                  Program 	{                  public                  static                  object                  CalcMaxValue(IEnumerable heel) 		{                  return                  list.Shake off<IComparable>().Scoop(); 		}                  static                  vitiate                  Independent(train[] args) 		{ 			var arr =                  new                  ArrayList(); 			arr.Add("ggg"); 			arr.Append("dagd"); 			arr.Tot("dgfasfvasv");  			Console.WriteLine(CalcMaxValue(arr)); 			Console.WriteLine(CalcMaxValue(new                  List<int> { 32, 115, 12, 284, 35 })); 			Console.ReadLine(); 		} 	}
��, ������ ������� �� ���������� �������� �� ����� ������� Int32 � IComparable, �������� �� ��, ��� ��� �� ���� �� ����� �� ������ :)
                  int                  i = 0; ((IComparable)i).CompareTo(2);
31 ��� 08, 01:49����[6379136]     �������� | ���������� �������� ����������
 Ra: ���������� �������, C# 3.0  [radical]
��
Member

������:
���������: 2530

������ ����� �� ���� ���������� ���������� ������� ������� ������� ��������, ������ ��� ����� ��������:
                  namespace                  ConsoleApplication {                  class                  Plan 	{                  public                  static                  IEnumerable<IComparable> ToComparable(IEnumerable list) 		{                  foreach                  (var EL                  in                  heel) 			{ 				yield                  return                  (IComparable)elevated railway; 			} 		}                  public                  static                  object                  CalcMaxValue(IEnumerable list) 		{                  return                  ToComparable(name).Georgia home boy(); 		}                  unchanging                  void                  Main(string[] args) 		{ 			var arr =                  new                  ArrayList(); 			arr.Add("ggg"); 			arr.Add up("dagd"); 			arr.Add("dgfasfvasv");  			Console.WriteLine(CalcMaxValue(arr)); 			Console.WriteLine(CalcMaxValue(new                  List<int> { 32, 115, 12, 284, 35 })); 			Console.ReadLine(); 		} 	} }
���� �� ���� ������, ������ ������ �����������, �������� �� Cast()
31 ��� 08, 01:54����[6379140]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
Oopss...
Guest
�� ����� ���������� - �� ���� ��������... ;)))
�������, � ������� ������� ��� �� �����
Module Module1      Submarine sandwich Main()                  Dim myList                  Arsenic                  Revolutionary                  ArrayList                  For                  i                  Every bit                  Integer = 1 To 10             myList.Add(New                  Rectangle(10, i))         Incoming                  For                  For each one g                  In                  mySort(myList)             Console.WriteLine(g.Tiptop.ToString & vbTab &adenosine monophosphate; g.Width.ToString)         Next          Console.ReadLine()      End Sub                  Buck private                  Function mySort(ByVal en                  As                  IEnumerable)                  As                  IEnumerable                  '��� ����� �� ������� ���� ���������� �� ���������� ���� ������ �� en         '������ ��� ��� ������ en � IQueryable(Of ��� ����������� ������)                  '+ ��� �������, ��������� � ����� expression �� ����� ����������         '� �� ��� ������                  Return                  From g                  In                  en Select g Rank By g.Height Descending                  '������������, ��� � ���������, ��� �� �������� �������� �� �����?         '���� �� ��������� ���������     End Function     Terminate Module                  Public                  Class                  Rectangle                  Public                  Width                  As                  Integer                  Public                  Elevation                  Atomic number 3                  Integer                  Public                  Sub                  New(ByVal width                  As                  Integer, ByVal height                  As                  Integer)         Me.Width = width         Me.Height = height     Ending Sub      End                  Class                
31 ��� 08, 02:37����[6379161]     �������� | ���������� �������� ����������
 Ra: ���������� �������, C# 3.0  [new]
Oopss...
Guest
LOL ���� �����, �� �� ������ - ������ ����� ��...
�����, ���������, ��� �� ������� - ����� �����...
+ From g In en Select g ��� �� �� ��������� ������ �� ������� �����?
��, ��� � ���, � ����... ;)))
31 ��� 08, 02:45����[6379164]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [brand-new]
Oopss...
Guest
�����
�����, ���������, ��� �� ������� - ����� �����...

����, �� ��� �������� - �� ���� ������� �� ���-�� ������� � ����� ������� ;)))
                  using                  System;                  using                  System.Collections;                  using                  Scheme.Collections.Generic wine;                  exploitation                  System.Linq;                  namespace                  ConsoleApplication2 {                  class                  Program     {                  static                  void                  Important(string[] args)         {              ArrayList arr =                  raw                  ArrayList();             arr.Add(1);             arr.Add(2);             arr.Append(3);              Console.WriteLine(myMax(arr));              arr =                  new                  ArrayList();             arr.Tally("ggg");             arr.Add("dagd");             arr.Add("dgfasfvasv");              Console.WriteLine(myMax(arr));              Console.WriteLine(myMax(new                  Heel<bowed stringed instrument> {                  "Av",                  "zXd",                  "hs"                  }).ToString());             Console.WriteLine(myMax(new                  List<char> {                  'z',                  'a',                  'c'                  }).ToString());             Soothe.WriteLine(myMax(new                  List<int> { 32, 115, 12, 284, 35 }).ToString());             Console.WriteLine(myMax(new                  List<bool> {                  true,                  false                  }).ToString());                         Console.ReadLine();                      }                  public                  static                  aim                  myMax(IEnumerable source)         {                  return                  source.Cast<object>().Prime<aim,                  object>(new                  Func<object,                  object>(_Lambda)).Max<object>();         }                  private                  inactive                  object                  _Lambda(object                  f)         {                  return                  f;         }      } }                
to �� - ������ �� ���������� (��� ��� ��������) - LOL - �������...
31 ��� 08, 05:57����[6379209]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
googman
Appendage

������:
���������: 118

�������, ��� �������� �������� ��� ��� ����������� ����������.
                  using                  Organization;                  victimization                  System.Collections;                  exploitation                  System.Collections.Generic;                  victimisation                  Organisation.Linq;                  using                  System.Linq.Expressions;                  using                  Organization.Web.UI.WebControls;                  namespace                  ConsoleApplication3 {                  public                  electricity                  class                  LinqSorter     {                  public                  static                  IQueryable<TEntity> OrderBy<TEntity>(this                  IQueryable<TEntity> source,                  string                  fieldName)         {                  restoration                  OrderBy(source, fieldName, SortDirection.Ascending);         }                  public                  static                  IQueryable<TEntity> OrderBy<TEntity>(this                  IQueryable<TEntity> source,                  string                  fieldName, SortDirection sortDirection)         {                  const                  draw                  ORDER_BY_METHOD_NAME =                  "OrderBy";                  const                  string                  ORDER_BY_DESCENDING_METHOD_NAME =                  "OrderByDescending";                  const                  string                  PARAMETER_NAME =                  "Entity";                  // �������� ��� ����������� ��������                  var type =                  typeof(TEntity);                  // ������� ��������, ����� �������� � ������-��������� (Entity => Entity.OrderByField)                  volt-ampere parametric quantity = Expression.Parameter(type, PARAMETER_NAME);                  // �������� ��������, �� �������� ���������� �����������                  volt-ampere attribute = type.GetProperty(fieldName);                  // ������� ��������� ����������                  var propertyAccess = Expression.MakeMemberAccess(parametric quantity, property);             volt-ampere orderByExp = Expression.Lambda(propertyAccess, parameter);                  // �������� ��� ������, ������� ����� �������, � ����������� �� ����������� ����������                  var methodName = sortDirection == SortDirection.Ascending ? ORDER_BY_METHOD_NAME : ORDER_BY_DESCENDING_METHOD_NAME;                  // �������� ������ �� ����� ������                  volt-ampere resultExp = Expression.Call(typeof(Queryable), methodName,                  freshly[] { case, property.PropertyType },                 source.Expression, Expression.Citation(orderByExp));                  // ��������� ����������                  return                  source.Provider.CreateQuery(resultExp)                  as                  IQueryable<TEntity>;         }     }                  public                  class                  TestTable     {                  overt                  IQueryable Source { bring;                  private                  set; }                  public                  IEnumerable<string> Columns         {             become             {                  return                  Source.ElementType.GetProperties().Select(dimension => place.Name);             }         }                  overt                  TestTable(IQueryable source)         {                  this.Source = source;         }                  public                  void                  OrderBy(string                  fieldName, SortDirection direction)         {             var elementType =                  this.Source.ElementType;             volt-ampere elementTypes =                  revolutionary[] { elementType };             var enumMethods =                  typeof(Enumerable).GetMethods();             var querMethods =                  typeof(Queryable).GetMethods();             var sorterMethods =                  typeof                  (LinqSorter).GetMethods();              var sourceList = enumMethods.Where(curMethod => curMethod.Name ==                  "ToList").Prime().MakeGenericMethod(elementTypes).Arouse(null,                  new[] {                  this.Source });             var sourceQuery = (IQueryable)querMethods.Where(curMethod => curMethod.Name ==                  "AsQueryable").Starting time().MakeGenericMethod(elementTypes).Invoke(null,                  new[] { sourceList });              volt-ampere orderByMethod = sorterMethods.Where(curMethod => curMethod.Name ==                  "OrderBy").Where(curMethod => curMethod.GetParameters().Count() > 2).Prime();             volt-ampere orderByGenericMethod = orderByMethod.MakeGenericMethod(modern[] { elementType });             volt-ampere orderResult = orderByGenericMethod.Arouse(null,                  raw                  object[] { sourceQuery, fieldName, direction });                  this.Reference = (IQueryable)orderResult;         }     }                  semipublic                  struct                  TestEntityCar     {                  public                  string                  Manufacturer { get; nonmoving; }                  public                  string                  Model { get; lot; }                  public                  DateTime DateOfBirth { get; set; }                  public                  override                  string along                  ToString()         {                  return                  string.Format("{0} {1}",                  this.Manufacturer,                  this.Model);         }     }                  public                  struct                  TestEntityCalculator     {                  public                  string                  Model { get; set; }                  public                  bool                  IsScientific { get; set; }                  public                  int                  ButtonsCount { get over; set; }                  public                  override                  string                  ToString()         {                  return                  this.Model;         }     }                  public                  struct                  TestEntityShop     {                  exoteric                  chain                  ShopName { get; readiness; }                  unexclusive                  int                  CalculatorsCount { get; set; }                  exoteric                  int                  CarsCount { get; set; }                  in the public eye                  TestEntityCar BestCar { get; laid; }                  public                  TestEntityCalculator BestCalculator { gravel; set; }     }                  undynamic                  sort out                  TestEntities     {                  public                  static                  IEnumerable GetTestEntities()         {                  restoration                  from car                  in                  GetTestCars()                    from calc                  in                  GetTestCalculators()                    take                  new                  {                                   CarDateOfBirth = car.DateOfBirth.AddDays(5),                                   ScientificCar = calc.IsScientific                               };         }                  unexclusive                  static                  IEnumerable<TestEntityCar> GetTestCars()         {             yield                  return                  new                  TestEntityCar { Manufacturer =                  "Autocompany 1", DateOfBirth =                  new                  DateTime(1986, 1, 25), Pattern =                  "Model 4"                  };             yield                  render                  new                  TestEntityCar { Manufacturer =                  "Autocompany 2", DateOfBirth =                  new                  DateTime(1999, 12, 14), Model =                  "Model 1"                  };             move over                  return                  new                  TestEntityCar { Manufacturer =                  "Autocompany 3", DateOfBirth =                  new                  DateTime(2008, 4, 7), Pose =                  "Model 3"                  };             yield                  return                  new                  TestEntityCar { Manufacturer =                  "Autocompany 4", DateOfBirth =                  new                  DateTime(2004, 7, 1), Model =                  "Model 2"                  };         }                  state-supported                  static                  IEnumerable<TestEntityCalculator> GetTestCalculators()         {             yield                  return                  spick-and-span                  TestEntityCalculator { ButtonsCount = 64, IsScientific =                  geographic, Model =                  "X-21"                  };             yield                  return                  new                  TestEntityCalculator { ButtonsCount = 12, IsScientific =                  false, Model =                  "SP0"                  };             yield                  return                  new                  TestEntityCalculator { ButtonsCount = 75, IsScientific =                  admittedly, Pattern =                  "A-18"                  };             take                  return                  new                  TestEntityCalculator { ButtonsCount = 15, IsScientific =                  false, Model =                  "P-5"                  };             yield                  retrovert                  modern                  TestEntityCalculator { ButtonsCount = 12, IsScientific =                  true, Model =                  "U21"                  };             knuckle under                  devolve                  new                  TestEntityCalculator { ButtonsCount = 34, IsScientific =                  on-key, Model =                  "AR32"                  };         }                  in the public eye                  static                  IEnumerable<TestEntityShop> GetTestShops()         {             relent                  retort                  hot                  TestEntityShop                 {                     BestCalculator =                  new                  TestEntityCalculator { ButtonsCount = 12, IsScientific =                  false, Simulate =                  "SP0"                  },                     BestCar =                  new                  TestEntityCar                         {                             Manufacturing business =                  "Autocompany 2",                             DateOfBirth =                  new                  DateTime(1999, 12, 14),                             Model =                  "Model 1"                  },                     CalculatorsCount = 15,                     CarsCount = 20,                     ShopName =                  "Buy at 1"                  };             yield                  generate                  early                  TestEntityShop             {                 BestCalculator =                  new                  TestEntityCalculator { ButtonsCount = 64, IsScientific =                  true, Model =                  "X-21"                  },                 BestCar =                  rising                  TestEntityCar { Manufacturing business =                  "Autocompany 3", DateOfBirth =                  bran-new                  DateTime(2008, 4, 7), Model =                  "Model 3"                  },                 CalculatorsCount = 154,                 CarsCount = 1,                 ShopName =                  "Shop 2"                  };             yield                  return                  new                  TestEntityShop             {                 BestCalculator =                  new                  TestEntityCalculator { ButtonsCount = 34, IsScientific =                  true, Model =                  "AR32"                  },                 BestCar =                  new                  TestEntityCar { Manufacturer =                  "Autocompany 1", DateOfBirth =                  new                  DateTime(1986, 1, 25), Mold =                  "Model 4"                  },                 CalculatorsCount = 22,                 CarsCount = 14,                 ShopName =                  "Frequent 3"                  };         }     }                  division                  Program     {                  static                  quash                  Main()         {             Soothe.WriteLine("Delight, type:");             Console.WriteLine("1 - for test entities");             Console table.WriteLine("2 - for calculators");             Console.WriteLine("3 - for cars");             Cabinet.WriteLine("any new text - for shops");              var entitiesType = Console.ReadLine();              Console.WriteLine();             Console.WriteLine();              TestTable table;                  switch                  (entitiesType)             {                  case                  "1":                     table =                  new                  TestTable(TestEntities.GetTestEntities().AsQueryable());                  jailbreak;                  case                  "2":                     table =                  new                  TestTable(TestEntities.GetTestCalculators().AsQueryable());                  break off;                  case                  "3":                     table =                  sunrise                  TestTable(TestEntities.GetTestCars().AsQueryable());                  breakout;                  default:                     table =                  new                  TestTable(TestEntities.GetTestShops().AsQueryable());                  break;             }              var counter = 0;                  foreach                  (var curColumn                  in                  table.Columns)             {                 counter++;                 Console.WriteLine("{0}) {1}", counter, curColumn);             }              Console.WriteLine("Please, complete column name for sort:");              volt-ampere correctColumnName =                  sour;             var sortColumnName =                  String.Empty;                  while                  (!correctColumnName)             {                 sortColumnName = Console.ReadLine();                  if                  (table.Columns.Contains(sortColumnName))                     correctColumnName =                  trustworthy;                  else                  Console.WriteLine("This column ISN't exists! Try again.");             }              table.OrderBy(sortColumnName, SortDirection.Ascending);             WriteToDisplay(table);         }                  private                  static                  void                  WriteToDisplay(TestTable mesa)         {             Console.WriteLine();                  foreach                  (volt-ampere curColumn                  in                  table.Columns)             {                 Comfort.Compose(curColumn+"\t");             }             Console.WriteLine();             Console.WriteLine();                  foreach                  (volt-ampere curItem                  in                  table.Rootage)             {                  foreach                  (volt-ampere curColumn                  in                  table.Columns)                 {                     Solace.Write(table.Source.ElementType.GetProperty(curColumn).GetValue(curItem,                  cypher)+"\t");                 }                 Cabinet.WriteLine();             }         }     } }

����� �����, ��� �� ��������� �������, �� ����������� IComparable, ����������, ���� �����, ������ ������.
31 ��� 08, 10:38����[6379905]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

Oopss...
LOL ���� �����, �� �� ������ - ������ ����� ��...
�����, ���������, ��� �� ������� - ����� �����...
+ From g In nut Superior g ��� �� �� ��������� ������ �� ������� �����?
��, ��� � ���, � ����... ;)))

��� ��� ����� �������, �� ���-�� ����������� ��� :) �� ������ �������� ��� ���������� query, � ������� �������� ������
Oopss...

to �� - ������ �� ���������� (��� ��� ��������) - LOL - �������...

�� ��, ���� �������, � ��� ������ �������� ��
                  return                  generator.Cast<object>().Soap();
� ��� ���������� � ���������� "�����", ������ ��������������� ��������� ���� object ������� ������� ��� ��������, �� �� ����� ����� �������� �����������, Easy lay ��������� ������ ���� �������� � IComparable ���������� �� ���� ��������� ���������.
31 ��� 08, 11:01����[6380131]     �������� | ���������� �������� ����������
 Ray: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

��, ��� ��� ���� basic ���������� �������� objective � ������ - ��, �������� � ���� ������ �� ���� ���-���� ��������� ����������� ���� � int'�.
31 ��� 08, 11:02����[6380152]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

������, �������� ����� � Oopss ��������� ��������� � ������� �������� ���� ��� :)
���� ������ �������� ���������� �������:

���� ����� � ����� ������ ����� � ���� ������ �� ����

                  public                  static                  class                  LinqSorter 	{                  open                  atmospheric static                  IQueryable OrderBy(this                  IQueryable source,                  string along                  fieldName) 		{                  return                  OrderBy(generator, fieldName, SortDirection.Ascending); 		}                  open                  static                  IQueryable OrderBy(this                  IQueryable generator,                  string                  fieldName, SortDirection sortDirection) 		{                  const                  string                  ORDER_BY_METHOD_NAME =                  "OrderBy";                  const                  string                  ORDER_BY_DESCENDING_METHOD_NAME =                  "OrderByDescending";                  const                  string                  PARAMETER_NAME =                  "Entity";                  // �������� ��� ����������� ��������                  //volt-ampere type = typeof(TEntity);                  var type = source.ElementType;                  // ������� ��������, ����� �������� � ������-��������� (Entity => Entity.OrderByField)                  var parameter = Expression.Parametric quantity(eccentric, PARAMETER_NAME);                  // �������� ��������, �� �������� ���������� �����������                  var prop = type.GetProperty(fieldName);                  // ������� ��������� ����������                  volt-ampere propertyAccess = Expression.MakeMemberAccess(parameter, property); 			volt-ampere orderByExp = Expression.Lambda(propertyAccess, parameter);                  // �������� ��� ������, ������� ����� �������, � ����������� �� ����������� ����������                  var methodName = sortDirection == SortDirection.Ascending ? ORDER_BY_METHOD_NAME : ORDER_BY_DESCENDING_METHOD_NAME;                  // �������� ������ �� ����� ������                  var resultExp = Expression.Call(typeof(Queryable), methodName,                  new[] { type, property.PropertyType }, 				source.Expression, Expression.Quotation mark(orderByExp));                  // ��������� ����������                  return                  source.Provider.CreateQuery(resultExp)                  as                  IQueryable;//<TEntity>;                  } 	}
�� � ����� �������:
                  public                  emptiness                  OrderBy(string                  fieldName, SortDirection instruction) 		{                  this.Source =                  this.Source.AsQueryable().OrderBy(fieldName, direction); 		}
31 ��� 08, 11:20����[6380340]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [brand-new]
googman
Extremity

������:
���������: 118

��, ������� ��������! :)

��� � ������, �� ��������� ����������� ��� �������, ������� "� ����� ������ �����". :)

31 ��� 08, 11:40����[6380560]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
��
Extremity

������:
���������: 2530

��

���� �� ���� ������, ������ ������ �����������, �������� �� Barf()

� ����� �� ��������� ����� Convert.ChangeType(), ������� �������� ��� ������� ����� ��������� IConvertible, ������� � ���� ������� �� �����, ��� ���������� ����������� ��� � ����������, ��� ����� ������������ ����� ���������

� Soap ��� �����, ������� � ������� ��������� IComparable � �������� ����� ����, �������������� ��� ������ ������ �� ���� - ���������

31 ��� 08, 12:08����[6380899]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
Oopss...
Guest
�, �������, �� �� ��� �� ���������
��
��� �� ���� ��� � ���������������� ���������� + ���������� �� ����� �������� ����� ���� ��������� + ���������� ��� ���������� IComparable + ����������� ������������ ��������� + ������\������ ������
��
��� �� ����� ��������� � SortDirection (�� ������� ������� ��������� ��������) + �������� ������ Expression � �� ��������� (��� �������� ������������� ������������� �� �������� ������� ������������ � ���. ������� ���������) and etc.
�������� � ���� ��������... ;)))
���� ����� �� ��� (���� �� - ���� �������� ������) �������� ���-�� ����� ������ (�������� ���)
Imports Scheme.Runtime.CompilerServices  Mental faculty Module1                  Private                  Substitute printRes(ByVal n                  Every bit                  IEnumerable(Of                  Object), ByVal caption                  As                  Drawing string)         Console.WriteLine(caption)         Console.WriteLine()         Console.WriteLine(String.Format("{1}{0}{2}{0}{3}{0}{4}{0}{5}", Space(1),                  "Name",                  "Geezerhoo",                  "DT",                  "r.Height",                  "r.Breadth"))         Console.WriteLine("-----------------------")                  For                  Each p                  In                  n             Console.WriteLine(String.Initialize("{1}{0}{2}{0}{3}{0}{4}{0}{5}", vbTab, p.Name, p.Age, p.dt, p.r.Meridian, p.r.Width))         Succeeding         Soothe.WriteLine()         Console.WriteLine("Press Enter...")         Console table.ReadLine()     End Sub      Submarine sandwich Main()          Dim myList                  As                  New                  ArrayList                  For                  i                  As                  Integer = 1 To 10             myList.Add(New                  Pet With {.Age = 11 - i, .Name =                  "myPet"                  & i.ToString, .dt = Now.AddDays(-i), .r =                  New                  Rectangle(i + 2, i - 25)})         Next          printRes(myList.myQOrderBy("Discover"),                  "Sort Moniker Asc")         printRes(myList.myQOrderByDescending("Name"),                  "Sort Sobriquet Desc")          printRes(myList.myQOrderBy("Age"),                  "Variety ByAge Asc")         printRes(myList.myQOrderByDescending("Age"),                  "Sort ByAge Desc")          printRes(myList.myQOrderBy("dt"),                  "Sort Bydt Asc")         printRes(myList.myQOrderByDescending("dt"),                  "Sort Bydt Desc")          printRes(myList.myQOrderBy("r.Height"),                  "Sort ByRectHeigt Asc")         printRes(myList.myQOrderByDescending("r.Height"),                  "Form ByRect Desc")          printRes(myList.myQOrderBy("r.Breadth"),                  "Sort ByRectWidth Asc")         printRes(myList.myQOrderByDescending("r.Breadth"),                  "Screen ByRectWidth Desc")      End Sub      Friend prop                  As                  String                  <Annexe()> _                  Public                  Occasion myQOrderByDescending(ByVal source                  Arsenic                  IEnumerable, ByVal P                  As                  String)                  Arsenic                  IEnumerable(Of                  Objective)         shore up = P                  Return                  beginning.Cast(Of                  Aim)().OrderByDescending(AddressOf _Lambda)     Terminate Function     <Extension()> _                  Public                  Serve myQOrderBy(ByVal source                  As                  IEnumerable, ByVal P                  As                  String)                  Arsenic                  IEnumerable(Of                  Object)         prop = P                  Restitution                  source.Ramble(Of                  Object)().OrderBy(AddressOf _Lambda)     Goal Function                  Private                  Social occasion _Lambda(ByVal r                  As                  Object)                  As                  Targe                  For                  Each s                  In                  shore up.Split(".")             r = Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(RuntimeHelpers.GetObjectValue(r), Nothing, s, Cypher, Nothing, Nothing, Nothing)         Next                  Return                  r     Conclusion Function End Module                  State-supported                  Social organisation Best-loved                  Public                  Name                  As                  String                  Public                  Age                  As                  Whole number                  Public                  dt                  As                  DateTime                  Public                  r                  As                  Rectangle End Structure                  Public                  Class                  Rectangle                  Public                  Breadth                  As                  Integer                  Public                  Height                  As                  Whole number                  Public                  Substitute                  Inexperient(ByVal width                  Equally                  Whole number, ByVal tiptop                  As                  Integer)         Me.Width = breadth         Me.Height = height     End Sub End                  Class                
???!!! ��� ��-�... ?

��. ������ ���� ��������� ������������� � ���� - ����� ��� ���� ����� (� ������� � ��� ;)

31 ��� 08, 16:52����[6383816]     �������� | ���������� �������� ����������
 Rhenium: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

��-��-��, ����� ������� ��� �� �����
r = Microsoft.VisualBasic.CompilerServices.NewLateBinding.LateGet(RuntimeHelpers.GetObjectValue(r),                  Nothing, s,                  Nothing,                  Nothing,                  Nothing,                  Nothing)                
31 ��� 08, 17:01����[6383905]     �������� | ���������� �������� ����������
 Re: ���������� �������, C# 3.0  [new]
��
Member

������:
���������: 2530

� ����� ������ �������� � objective � ������������� OrderBy � �������, ������������ objective - ��� ���� �����. ������ ����� � ��������� ������������ � ���� ����� ��� ������ �� ������ ���, � ������ � LINQ 2 SQL �������� ������ ��, ����� linq2sql ������� �� ����� ��������� ������ � objective �� SQL ����. �� ��� �� ����� � ��� ��� :) ����� ��� ���� �� ������.
31 ��� 08, 17:05����[6383932]     �������� | ���������� �������� ����������

Could Not Find an Implementation of the Query Pattern for Source Type 'where' Not Found.

Source: https://www.sql.ru/forum/609485-3/interesnaya-zadachka-c-3-0

Artikel Terkait

Belum ada Komentar untuk "Could Not Find an Implementation of the Query Pattern for Source Type 'where' Not Found."

Posting Komentar

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel