zzz projects Dapper Tutorial
Getting Started Documentation 3rd Party Libraries Knowledge Base Online Examples
  • Getting Started
  • Documentation
  • 3rd Party Libraries
  • Knowledge Base
  • Online Examples
  •   Download  

Dapper Tutorial - Knowledge Base (KB)

43 results for: in tag: linq

How do I rewrite this to be more LINQy?

I have this set of data here. Events has a property ...EventGroups... that is of type ...List<Groups>...List<Events> e; List<Groups> g; // Get the data from the database using dapper using( var con = DataAccessMaster.GetOpenConnection( ) ) { using( v...
c# dapper linq
asked by jcolebrand

Dapper parameterised queries with LINQ autogenerated types

I'm using a combination of LINQ and Dapper in my work. I'm replacing my LINQ code with Dapper in places for performance reasons. I have a lot of LINQ data objects created by dragging and dropping into the Visual Studio database diagram from SQL Server..
c# dapper linq
asked by Giles Roberts

Why doesn't Select() convert a IEnumerable<dynamic> to IEnumerable<StrongType>?

I'm trying to use Dapper simply to map my database tables to types in C#, however, some of my types need additional elements that are not in the table. To do this I am using a factory that can take column values and set the appropriate properties....publ...
c# dapper linq
asked by Doug Wilson

Using Contains() on an IQueryable built with Dapper (with MVCContrib Grid)

I've got the following ActionResult in a ASP.NET MVC 3 project:...public ActionResult Index(string searchWord, GridSortOptions gridSortOptions, int? page) { var userListModel = new PagedViewModel<UserModel> { ViewData = ViewData, Q...
dapper iqueryable linq mvccontrib-grid
asked by Nick

Creating a two dimensional array from a Dapper result

Is this the least amount of code I can use to convert a Dapper query result to a two dimensional array?...var array = cn.Query(@"SELECT Id, Desc FROM Things") .Select<object, ArrayList>(d => { return new ArrayList {((dynami...
c# dapper linq
asked by Kev

LINQ Expressions Body ToString

I'm wondering if somebody can explain to me the downside of retrieving...(Expression<Func<T, bool>>) Expression.Body ...at runtime and operating on this as a string?...for example given the following...public partial class Tests : Form { public Tests(...
dapper lambda linq regex string
asked by Brett Smith

Why does using Linq's .Select() return IEnumerable<dynamic> even though the type is clearly defined?

I'm using Dapper to return dynamic objects and sometimes mapping them manually. Everything's working fine, but I was wondering what the laws of casting were and why the following examples hold true....(for these examples I used 'StringBuilder' as my know...
casting dapper dynamic linq
asked by BlackjacketMack

Project dynamic Dapper results excluding some properties

Given a dynamic Dapper query such as:...var results = connection.Query<dynamic>("SELECT ...."); ...I want to remove a couple of the returned columns/properties from the results. The trick is I want to do this without knowing/caring the names of the proper...
c# dapper linq
asked by Brian Vallelunga

How to use Multi-Mapper to create multiple one to many object hierarchy

I have my 2 models like below ...public class FItem { public FItem() { } public int RecordId { get; set; } public int MarketId { get; set; } public string ItemName { get; set; } publi...
c# dapper linq
asked by Kuntady Nithesh

one-to-many insert using dapper dot net

I have seen here...How to insert an IEnumerable<T> collection with dapper-dot-net...how dapper is able to handle ...IEnumerable... as an input param and dispatch multiple commands for each member of the collection....In my case I have an ...IEnumerable<in...
c# dapper linq
asked by Pricey

alternatives for Sqlinq to create sql queries from linq

Sqlinq... is an opensource project to create sql queries from linq. I'm using it with ...Dapper..., but unfortunately it doesn't support JOINs. ...Is there are any other libraries that do the same thing and supports JOIN too?...If not, what could be a so...
.net dapper linq sqlinq tsql
asked by mohsen dorparasti

Join navigation property with line

I try to join a navigation property by using LINQ. This is my code... var activities = Using<GetActivitiesForUser>() .Execute(User.DisplayAs, User.MarketId); var contacts = Using<GetContactsForUser>() .Execute(User.DisplayAs, User....
c# dapper linq
asked by Nils Anders

How to convert List<Dapper.SqlMapper.FastExpando> to runtime type (List<IDictionary<string,object>>)

I'm using a method that has a return signatur of ...IEnumerable<dynamic>.... At runtime for a particular call it is returning ...List<Dapper.SqlMapper.FastExpando>.......var x0 = repo.Find(proc, param); //x0 runtime type is {List<Dapper.SqlMapper.FastExp...
c# casting dapper dynamic-language-runtime linq
asked by Jay Walker

dapper aggregation function error

have this aggregation function in my code using Dapper ...var sql = (@"SELECT * FROM [pubs].[dbo].[authors] as a right join pubs.dbo.titleauthor as b ON a.au_id = b.au_idT"); var data = connection...
c# dapper linq
asked by MuhanadY

Checking for duplicates before updating with dapper linq c#

I'm relatively new to Linq and Dapper and I'm trying to find the most effecient way to make an insert happen. I have a list object that looks like this: ...public class Programs { public int Id { get;set; } public int Desc { get;set; } } ...The li...
c# dapper linq
asked by Elaine K

dapper linq Object reference not set to an instance of an object

I have simple customer table that has 4 records, and only one has email...public string Username { get; set; } public string Email { get; set; } ............ var data = cn.Query<Customer>("select * from customer"); var aaa= data.FirstOrDefault(f => f.E...
c# dapper linq
asked by nam vo

Dynamic Linq on Dapper dynamic collections - possible?

We are investigating using LinQ to query an internal dynamic collection created by Dapper. The question is:...How to execute dynamic LinQ against the collection using Scott Guthrie dynamic linq (or some other technology if possible)? (...http://weblogs.as...
c# dapper linq
asked by user2512533

Populate list from linq query result

I have the following code, I'm returning results that are associated with the userId, I then want to loop through the results and build a collection and return it back to the UI.... public List<UserEmails> LoadUsersInbox(Int64 userId, int status) { ...
c# dapper linq list
asked by Code Ratchet

Get First Single matched element or First if there's no match?

Is that possible in ...LINQ... to write a nice one-liner to get a ...first matched element or if there's no match than get first element... in the collection?...E.g. you have a collection of parrots and you want yellow parrot but if there's no yellow parr...
c# dapper linq sql-server
asked by user1249170

Dapper nested object query - not populating all properties

I am trying to return a flat result set into a nested object with Dapper.NET (EmergingIssue contains both Reason and Status objects), but the query is not populating all the columns. See POCOs below:...public class EmergingIssue { public string Catego...
c# dapper linq
asked by user1077685

Page 1 of 3
  • 1
  • 2
  • 3
  • ยป

Prime Library

Performance

  • Entity Framework Extensions
  • Entity Framework Classic
  • Bulk Operations
  • Dapper Plus

Expression Evaluator

  • C# Eval Expression
  • SQL Eval Function
More Projects...