« first day (2343 days earlier)      last day (2831 days later) » 

15:00
@RoelvanUden For what Entity Framework does, it isn't slow. But compared to what functionality you need, it isn't required. You can usually simplify the tool for those benefits.
@peterpep Yeah, Entity Framework does a lot of really, really cool stuff. It comes at a cost though.
That's what makes it 'slow', and the fact that by default it does 'change detection' whenever you add/update/save. Turn that off and do it only pre-save and you get a massive performance boost, too. Also, change detection works on things you KNOW you haven't touched.. so not tracking them saves you a lot of time, etc, etc.
EF6 can be tuned to be extremely fast.. the default is just set to be very forgiving and flexible
@RoelvanUden Yeah, you also need to make sure Lazy Loading is enabled.
Actually, disabling it is far faster.
But requires some forethought into what you need to access.
@RoelvanUden I find the Lazy Loading works a bit better in async environments, my experience. I could be mistaken though.
EF can come really close to Dapper if you throw every convenience overboard, but you can just trim it down to what you need and get the power/flexibility of EF with the performance that is achievable. Just saying 'EF is slow' is just wrong and a sign of incomplete knowledge.
@Greg Fear n+1 queries ;-)
15:04
@RoelvanUden But Dapper can dynamically build your entities, track them even, and I don't have to disable anything. The performance is already there.
Dapper doesn't do tracking, only materialization.
I'm anxious for Entity Framework 7 Core.
@RoelvanUden There is an addon to it, that allows you to track.
this kind of sounds like webforms vs MVC
But you sacrifice a lot of the performance and come close to EF terms.
I mean, sure, fine if you love it, that's great. But EF is in no way worse.
That is true.
15:07
webforms being ef and mvc being dapper
Nah, it's a completely different discussion.
@RoelvanUden I never said it was worst, I simply said it is slower and more bloated. But with Entity Framework 7 (Core) being released. Where they removed a lot of the legacy EF 4 API in favor of DbContext and performance tweaks should be nice.
WebForms has no right to exist. Dapper does.
doesnt EF6 use DbContext?
edc
edc
WebForms is just too outdated for today's web site's requirements
15:08
Yeah, but EF6 is backward compatible whereas EF7 isn't
I can't remember the old EF4 API before DbContext was introduced, and based off of. Now that DbContext is written to its own, vs that old API it should be far better.
i think it was objectcontext
or some shit like that
@RoelvanUden How have you been, haven't seen you in awhile.
Somewhere between utter shit and totally awesome. It's been a sine lately.
@Greg he died and came back to life as a java developer. Obviously he had some bad karma
15:09
lol
ive always hated java
Hate, hate leads to the dark side.
nice i can become a sith lord soon then?
Java, I can't talk. I've been pulled into Swift development.
you working on mobile?
for the life of me, in website development i still dont understand when to use APIController vs regular controller
Yeah, we have some native mobile applications.
15:14
Swift isn't terrible at least.
No, I actually really like it.
ive been trying to google this to no avail
:controller vs :apicontroller
Is there a "weakreference-list"? Where the elements are encapsulated by weakreferences, I feel like I'm reinventing the wheel now.
:controller should be used only when trying to prepare views?
:apicontroller when handling requests that dont return a view?
controller for things that arent api, like with sessions, viewstate, and/or views.
apicontrollers for.. apis.
15:25
i guess i have an incomplete understanding of apis
api's just return xml/json or nothing, web api has the concept of controllers for api's.
mvc controllers return a view, for a webpage.
api's can be hit by web pages, backend systems, mobile devices
so, 2 controllers, 2 different uses
so CRUD would be for mvc controller
not apicontroller
can an api crud? sure
it just doesn't have a user interface
it's the same thing, just one provides a user interface, and one doesn't
you could literally have an mvc controller with the same exact functionality of a web api controller
15:32
i guess i dont understand enough about the use-cases when you dont want to return a user interface
the web api controller can be called from code, the mvc controller is called via the browser
Not literally, but almost. An ApiController that uses session is a bad controller.
okay
so lets say you have a web page and a mobile app
they do the same thing, should you write the code twice?
lets say it's for booking hotels
you could write all the logic required to book a hotel room twice, or you could write an api.

the api can be called from javascript (code), and from the mobile app
because the api doesn't care how the data is presented, thats up to whoever uses the api
(not 100% accurate if you're talking microservices, but for our discussion)
15:34
can an api be fed into controller?
web api has controllers
i'm not sure what you mean
to present a view
you can call an api from code, so, yes, you could call an api from mvc controller
although, normally you wouldn't if the api and mvc app live in the same solution
I've checked that I've a valid connection and table name. The DB contains rows. But when I map the result to an object the count is zero. Any keen eyes spot what's wrong here?
@BrianJ where is escalation used?
@SteveG thanks for trying to explain it to me. i really need to look into API's more.
15:37
code review: why project to an anon type just to project to a concrete type on the next statement
i dont see a statement in his code block where he does any saving to his db
@peterpep forgot to add that, it's the typed list that I map to
@peterpep thats because he's reading, and his problem is while reading, he gets 0 results back
Why is it that with a HashSet, if you add two values that are the same, the set only shows one, but if you add two reference types, the set shows the two reference types?
@SteveG I wasn't sure how to do it in one statement. I'll give that a try
user7480455
15:40
I have a Question Gurus... can EF handle complex sql like a nested sql statement?
wouldnt you just add .toList in the first segment?
this code doesnt make sense to me
you do .toList. select new .toList again
@Nathvi Lol. A hash set does never contain duplicate values, that's the whole purposes of it, really. Two different reference types are two different values (two different pointers to mem)
@007 sure
var escalation_list_anon = from a in escalationDB.Escalations
                                               select new
                                               {
                                                   Application = a.Application,
                                                   UpdatedTime = a.UpdatedTime,
                                                   EM = a.EM,
                                                   OutageStart = a.OutageStart,
                                                   status = a.status,
user7480455
ok thanks Roel
wouldnt this remove the need for that second set of code?
15:42
@BrianJ when you do escalationDB.Escalations.Count() whats it return?
i think i know the problem
he is setting a list equal to another list
shouldnt he add a foreach(var escalation in whatever) { escalations.Add(escalation) }
@SteveG I get count zero from - int count = escalationDB.Escalations.Count();
that is before I do any linq
That seems to me that my connection isn't working
you already have data in it?
wait should my connection string name be the same as the context class name?
because I've set up the conn string name different to the context class. It might not be able to find the correct string
if the connection was failing wouldnt this if (escalationDB.Database.Exists()) cause an error?
15:49
yep that was it, wrong conn string name
ahh
relief
lol
wooo
@peterpep thats what i thought
but maybe he's pointing at a local db instead of a dev one or something
even if hes pointing at a local db i dont see how the conn named was used that could affect this
he only used .connection in logger
unless the error was outside of this if block
but if its not connection to the db, the if statement should return false
if im not mistaken
I was getting the context instance like this, but the correct conn string wasn't specified to match that class
scalationContext escalationDB = new EscalationContext();
16:08
im just shocked you didn't get a 'cannot connect' exception of some sort
anyway, taco bell diablo sauce
is not hot enough
yeah..that was fine but my other context on an Oracle DB is funking up
need to look at it
16:34
here comes the
booooom
17:06
Here Comes the Snow
Winter is coming.
hey that's my line
winter came 28" last night
!!lenny
( ͡° ͜ʖ ͡°)
@Failsafe thats how much snow ya'll got?
17:17
juanvan got 32
Winter came.
Actually first days of spring here in the netherlands.
It got in my hair and everything.
At least the weather is acting like it is spring.
17:19
anyone set up an oracle connection in entity framework before?
i have not
oracle is gross
I've set the string same as the mssql string. But specified providerName="Oracle.ManagedDataAccess.Client" as provider. Then try to acccess the same way as I do with the MSSQL db. But it can't connect.
ah so got a bit more detail on the error `TNS:could not resolve the connect identifier specified?

`
Try not using Oracle.
user7480455
Linq question again all... I am trying to convert this sql statement to linq... which means I have no clue what I'm doing... SELECT * FROM [dbo].[TB1] WHERE VI_ID NOT IN (SELECT VCD_VEH_ID FROM [TB2].[dbo].[DATES] WHERE VCD_REQ_DATES BETWEEN CONVERT(DATETIME,'03/21/2017')+''+'11:00' AND CONVERT(DATETIME,'03/25/2017')+''+'14:00')
user7480455
17:32
so I have founded a post showing hot to nest stuff with linq
user7480455
but I am having trouble with the first table because my sql query uses all the columns
user7480455
in the first select
user7480455
Any tips or trick?
user7480455
s
@mikeTheLiar can't it's the source of the data I need :P
user7480455
17:34
or should I just use a stored procedure due to the complex nature of the query?
18:05
Do any of you know if you can have ClickOnce run a script at the end of the install?
I have two objects: `Book b1 = b2;`
I don't want to reflect changes of `b2` on `b1` after that line, what are the options?
you need to make a copy
or a clone
Dan
Dan
Ahoy hoy
generally the type needs to support this operation
18:12
@milleniumbug How?
@007 oh thats not complex
where does it get 3/25 and 3/21
@MohamedAhmed there's no easy built in way in .NET to the best of my knowledge
@MohamedAhmed is Book your own type or not? If yes, you can implement ICloneable and copy every member
Isn't IClonable like, super deprecated?
seems to have issues whether the type specifies deep cloning/shallow cloning, but I've yet to hear it's deprecated
18:15
> The ICloneable interface simply requires that your implementation of the Clone method return a copy of the current object instance. It does not specify whether the cloning operation performs a deep copy, a shallow copy, or something in between.
@milleniumbug it's my own type
jfc that sounds awful
but no worries, you can disregard implementing ICloneable, and just make a Clone() operation without implementing that one
@MohamedAhmed make a public Clone() operation, call var newBook = (Book)this.MemberwiseClone(); inside it, make fixups, and return it
if your Book type only stores values of simple types like ints, doubles or strings you don't need to make fixups
but if you store collections, you need to make copies of them
otherwise your newBook and this will share the same collection object
generally the more complex your type, the more complex implementation of such cloning operation is
Dan
Dan
Anyone ever experience problems with ServiceKnownType not working at all? When I try to hit the service decorated with it, it complains that it can't find the specified method in the class (I'm using the overload that takes a helper method/class to return Type[])
    [ServiceContract]
    [ServiceKnownType("GetServiceKnownTypeSet", typeof(ServiceKnownTypeProvider))]
    internal partial interface ITsmService { ... }

    internal static class ServiceKnownTypeProvider
    {
        public static IEnumerable<Type> GetServiceKnownTypeSet() { ... }
    }
i need to init a local git repo, then add a remote... then push my local to a specific branch in the remote
do i need to checkout the branch locally first before adding the repo (the branch already exists in the remote)
or would i just add the remote then checkout the branch and commit/push what i got?
Dan
Dan
18:25
> ServiceKnownTypeAttribute in ITsmService refers to a method GetServiceKnownTypeSet that does not exist in type ServiceKnownTypeProvider
18:59
@007

« first day (2343 days earlier)      last day (2831 days later) »