Find Jobs
Hire Freelancers

C# LINQ Custom Provider to SQL

£20-250 GBP

В роботі
Опублікований about 12 years ago

£20-250 GBP

Оплачується при отриманні
I want to use a custom LINQ provider to replace 'Parameter' object functionality that I've had in my Repository queries until now. These parameter objects took the following kind of form: PersonParameters { Id { get; set; } LastName { get; set; } FirstName { get; set; } } This object gets passed into the repository's Query(PersonParameters) method which in turn get forwarded it on to the DAL which would build an SQL query. The recordset output from this query got passed to an ObjectBuilder that constructs a Person objects which satisfy the parameters. I want to change these Query(PersonParameters) methods to return an IQueryable<T> to give me the flexibility of LINQ to replace the Parameter objects that build the SQL query. What I'm looking for is someone to create a QueryProvider that will take a Dictionary<string, string> that will map the incoming predicate's arguments to a database field. For example, if the following classes existed: Animal { string Name { get; set; } int NumberOfLegs { get; set; } Species Species { get; set; } } Species { string Name { get; set; } } Repository<Animal> { IQueryable<Animal> Query(); } I'd be able to write a query that looked like this: var animalRepository = new Repository<Animal>(); var query = [login to view URL]().Where(T=>T.NumberOfLegs=4 && [login to view URL] == "Lion").OrderBy(T=>[login to view URL]); I want a QueryProvider that will generate SQL with properties mapped to custom SQL field names. For example consider the following interface: IQueryMap { string TableName { get; } string[] TablesFields { get; } Dictionary<string, string> Mappings { get; } } An object that inherits this interface could be created with the following properties set: TableName = "AllTheAnimals"; TablesFields = new string[] { "id", "animalName", "animalsNumberOfLegs", "theAnimalSpeciesName", "amountOfFur" }; Mappings = new Dictionary<string,string>(); [login to view URL]("Name", "animalName"); [login to view URL]("NumberOfLegs", "animalsNumberOfLegs"); [login to view URL]("Species.Name", "theAnimalSpeciesName"); If this object were passed into the provider along with the query from above it would generate SQL that looks like this: SELECT animalName, animalsNumberOfLegs, theAnimalSpeciesName, amountOfFur FROM AllTheAnimals t0 WHERE [login to view URL] = 4 AND [login to view URL] = "Lion" ORDER BY [login to view URL] So essentially I want to create my own mapping objects that will be passed into the QueryProvider that map the LINQ query to SQL field names. I will then create the objects manually from the QueryProvider recordset enumerator. I've been referring to a microsoft tutorial here: [login to view URL] but have gotten confused by Expressions, ExpressionVisitors, etc etc etc etc I'll send through interfaces that I'm programming against for your reference. Many thanks
ID проекту: 1602094

Про проект

8 пропозицій(-ї)
Дистанційний проект
Активність 12 yrs ago

Хочете заробити?

Переваги подання заявок на Freelancer

Вкажіть свій бюджет та терміни
Отримайте гроші за свою роботу
Опишіть свою пропозицію
Реєстрація та подання заявок у проекти є безкоштовними
Доручений:
Аватарка користувача
Hello Sir, please checkout my message
£250 GBP за 4 дні(-в)
5,0 (77 відгуки(-ів))
7,1
7,1
8 фрілансерів(-и) готові виконати цю роботу у середньому за £223 GBP
Аватарка користувача
Hello, i have 8 years experince in c#
£400 GBP за 10 дні(-в)
5,0 (42 відгуки(-ів))
6,6
6,6
Аватарка користувача
Hi, I have gone through your requirement and I am glad that We can accomplish this task, Please give us opportunity to work with you. Please check PM . Thanks, TTS Team
£150 GBP за 5 дні(-в)
4,9 (33 відгуки(-ів))
5,2
5,2
Аватарка користувача
Please see pmb
£250 GBP за 4 дні(-в)
5,0 (2 відгуки(-ів))
2,2
2,2
Аватарка користувача
Hi, Alvicreatives has been long into web application development & designing and development business. The last 5 years, we are working on web based ASP.net / C#, Sqlserver 2005/2008, Ajax, CSS, Flash,PHP,MySql,WordPress,Ecommerce & SEO projects and look forward to concentrate on such projects only. As per your project, we give the cost & time frame for a milestone. Our team matches the required skill set and thus we are confident in taking up this assignment. I look forward to hear from you. Best Regards, Team, Alvicreatives.
£190 GBP за 3 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0
Аватарка користувача
Expert C#/LINQ/SQL developer. plesae see PMB.
£170 GBP за 1 день
0,0 (0 відгуки(-ів))
0,0
0,0
Аватарка користувача
PLEASE CHECK PMB
£150 GBP за 3 дні(-в)
0,0 (0 відгуки(-ів))
0,0
0,0

Про клієнта

Прапор UNITED KINGDOM
London, United Kingdom
5,0
10
Спосіб оплати верифіковано
На сайті з трав. 2, 2012

Верифікація клієнта

Дякуємо! Ми надіслали на вашу електронну пошту посилання для отримання безкоштовного кредиту.
Під час надсилання електронного листа сталася помилка. Будь ласка, спробуйте ще раз.
Зареєстрованих користувачів Загальна кількість опублікованих робіт
Freelancer ® is a registered Trademark of Freelancer Technology Pty Limited (ACN 142 189 759)
Copyright © 2024 Freelancer Technology Pty Limited (ACN 142 189 759)
Завантажуємо для перегляду
Дозвіл на визначення геолокації надано.
Ваш сеанс входу закінчився, і сеанс було закрито. Будь ласка, увійдіть знову.