« first day (1438 days earlier)      last day (3515 days later) » 

9:00 AM
@gurun What's so horrible about it?
 
Its 5 levels of indirection and makes debugging model transformations almost impossible,
It's like when people apply DRY to unit testing.. Makes for very good good code. Makes it completely impossible to follow the tests.
You get all your poor mapping errors runtime instead of compiletime. And try renaming a parameter in one model, it's not like it will automatically find it and replace on the other side.
Automapper is evil. But it has its purpose too I guess. Maybe shouldn't blame the framework for being abused :-P
 
It's evil. Write your own mapping code for clarity and sanity.
 
The software I worked on last, a rather big and complex system. We had lots of different types of transfer models, view models and stuff. And then one of the coders decided to refactor the whole thing and put in automapper.
 
I have to say I don't get on with AutoMapper either. Although I prefer it to crappy hand-crafted mapping which gets long
AutoMapper often just leaves values null for no obvious reason
 
At least hand-crafted code will break when it is supposed to.
 
9:06 AM
So, it shutdown the system for almost a year (not kidding). They hunted bugs for a year, runtime. With the customers. Obviously they had general problems with testing too, but the number of regression errors exploded.
I mean, they didn't release any new features for a whole year.
And she you start seeing code like (entity layer.find(ID)) doing database lookups in the middle of the automapper code.. Then, Jesus how messy it can get.
 
One more point to simplicity and predictability. Less magic, please!
 
Yes
I actually fired one of my coders on the spot (only happend once).
 
Although, I pretty much find F# unreadable at this point, so it's not simple to me. So learning about certain concepts in C# might avoid going to dumb
 
Was just about using automapper in a project, I guess its better to just write my own adapter class
 
He out in razor views in the project before we had any real syntax highligtning and command completion in VS for it.
Out=put
It's the same kind of thing. You don't get any errors during compile, and no help writing he code properly, and no refactoring support. He couldn't understand that. We discussed it. He did it anyway. And he was fired on the spot.
@Kraz, I don't think any of us mean "don't use automapper". But we mean use it with caution, and be aware what can happen if you abuse it.
 
9:13 AM
It's really nice for small short-lived projects.
Where you can keep an overview of what's going on.
 
I mean, if you do MVC you have the same style of setting properties too. Just not as advanced. But I have to admit, I find very very limited use of that stuff in MVC. It looks good in Microsoft demos though.
 
Otherwise, steer clear, just invest the time.
 
Actually for small projects, I would rather break layering of the models instead of using any mapping. Like, use the entities all they way out as long as you can. Makes prototyping much easier.
And then, when needed, when the system gets more stable (functionality wise) start replacing with DTOs and similar.
 
I wonder how F# fares in that department..
 
I'm still trying to figure out what the hell FartSharp is all about. I know Other functional languages, but can't figure out what F is about.
When I look at code they do, it either looks like broken C# or broken PowerShell
 
9:20 AM
It seems really powerful but I've not invested enough time in it yet (<2h)
 
GUYS
 
I don't know the implications but guaranteed no null is appealing, even with C# contracts
 
You know this is a SO chat. We are not supposed to have opinions on SO!
 
What's like the equivalent to console.log in C# so I can see the value of one of my variables?
 
Meh, this is chat, we can discuss whatever we want.
@Shaun Use the debugger and hover over it. Otherwise, Console.WriteLine
 
9:21 AM
I'm having problems debugging at the moment, symbols can't be loaded ¬_¬
 
Use a debug build?
 
On my old project, it takes more than 30 minutes to run the unit test.
So they only run it on release builds.
And then they can't really debug the stuff when it breaks either.
 
I'm shit at debugging anyway
I hate debugging WCF
 
Hi I am trying to set value to ASP.NET MVC container using JS. What is wrong with it?
container = document.getElementById('myCanvas');
if (!Detector.webgl) container.innerText = Detector.addGetWebGLMessage();
 
What is Detector?
 
9:33 AM
@gurun HTML content - innerHTML
 
Ok.
Well, I have no idea,but I can tell you what you need to do.
 
Google, yes.
 
Remove the fluff fluff and just hardcode the innerText="text" and see if that works.
Remove the IF statement too when you try that.
(No google, I'm not that evil)
Sort, of narrow down where it goes wrong.
 
:D
 
I LOVE JS. And I know MS LOVES JS too. Why else would they feel the urge to write a new language and compile it into JS :-)
 
9:38 AM
if (!Detector.webgl) container.innerText = "test";
Works
 
Ok. Great.
 
It is innerHTML
so I guess it would have function for that too.
 
Ohm container is like DOM or?
 
Not sure what does that mean.
 
But at least you came a step further now, right?
The addGet... Stuff. What does that return?
InnerText and InnerHTML is typical XML/HTML DOM API stuff.
 
9:40 AM
It returns innerHTML. But I see there is some issue with reference.
When I type: Detector I do not get any IntelliSense
 
Ok. Good. So you know hat method returns something that is "not inner text"
 
But it does not matter in my case. It is ok. I will put that message in string.
@gurun Thanks for this clarification!
 
Check it for null then, in the IF. Keep the "text" for now.
 
hi all
 
still doing taht mvc marek :p
 
9:44 AM
@marek are you using 51 degrees?
 
@Shaun Yeah, /started/ to like it much.
 
is that sarcasm? ^^
 
@Shaun Not really! Got into it and feeling like I understand atleast the basics of MVC!
@gurun No idea what that means:/
 
Is there any other way apart from using a DataReader to pull a table from a database and declare it as a variable so I can use it for comparison?
 
Marek, I just googled Detector to see if that was some framework thing.. And got a hit on another framework. That's why I asked.
 
9:47 AM
@gurun It is Three.JS library.
 
@shaun are you still on that oracle problem?
 
@gurun I am :(
 
@Shaun Well, not sure if correct but isn't LINQ way to go?
 
So, "pull a table" doesn't really mean much., or can mean anything. I mean that is just "English". So maybe ..repeat what the problem is you want to solve and maybe we can help you find a different strategy?
 
@gurun Okay I have a db and I need to get all the data from a table and check that it's if it equal to my variable then only load the results that match the variables value
 
9:50 AM
Ok
 
so my variable ORIG_LOGDB has a value of 'Lester' and I need to check the database table "ORIG_LOG" for any results that have the value 'Lester'
 
So, this is basic SQL stuff, right. You are new at this right? So I don't misunderstand...
 
Ok
 
Uh, I've done a bit before but not as complex as this
should I pastebin my codE?
there's a bit mroe to it than that
 
Nah, hold on.
Did you manage to execute a SQL query toward the DB in the code?
 
9:52 AM
Yes, I can load the data from the table by using the query with a WHERE clause in
however I can't have a where clause in the query
 
How much code is it.. Just a couple of lines or. That case, you can paste it think. I don't think they guys mind that..
 
Q: Is there any cool website has database of nice text design styles in CSS?
 
@Marek you mean fonts?
 
Yes.
 
@Marek, go through the bootstrap website and look for fonts. They link to a site there that has lots of opensource web enabled fonts. I'm sorry I don't remember where.
You know bootstrap?
 
9:55 AM
Uuuurrrhhhhhh
 
@Shaun why can't you have a WHERE in the SQL?
 
@gurun Yes. Ofc, thanks.
 
Currently lying on some guys sofa in Plymouth
 
@gurun Cause there'll be more than one table I have to filter and the value of ORIG_LOCDB always changes
 
@Sippy, if you practice your coding you might buy your own sofa later :-)
 
9:57 AM
Uhm
 
hey sipps I thought you were dead
 
Graduated yesterday
Went out last night and spent £150
 
@Shaun could you mail me the code? The part you are working with?
 
/me loves all these snippet, paste, screenshotty things on internet :-)
 
10:00 AM
It still hurts looking at raw SQL readers.
 
@Shan
give me sec to go through..
 
no worries, I appreciate the help :)
 
origLocDB == ORIG_LOC
should use .Equals(..) but well, it should work anyway.
but
you are using tostring on the dr2["ORIG_LOC"]
 
I had a feeling that was the problem
 
I wonder.. if it actually give you want you expect. Have you looked at the result from that?
let me check the oracle documentation.
 
10:04 AM
I tried but console.log wouldn't work
writeline
even
 
it says it would give you back an object in its native format.. whatever the hell that mean.
what is the type of that column in the oracle database? A varchar of sorts of?
And BEWARE, document says "This method is kana-width insensitive". Just in case you ever wanted to know.
(for the record, i have no fucking clue what Kana-width" is :-)
 
CHAR 7 BYTE
that's ORIG_LOC's data type
 
ok. let me check that then.
Or .. let me ask this.
Do you get into the IF() .. ?
if (origLocDB == ORIG_LOC && PlanWrkOrigDepDB == PLAN_WRK_ORIG_DEP && uwttidDB == uwttid)
 
I'm not actually sure, my debugging isn't working at all
 
ok, but worry not.
 
10:09 AM
so frustrating
 
debugging is far overrated
do you have unit-tests in the project, so you can run some code?
so you can run .. that code only?
 
I do not
 
a console app then?
with a main
 
I've got a windows form test harness thing
just to see what ti gives back
 
Argue time: Unit Tests are overrated, debugging is not. :-3
 
10:10 AM
the code looks very stand alone.
create a console project.. and copy/paste that code into Program.Main. So you can run it on its own.
 
ORIG_LOC won't have a value then
 
@RoelvanUden Agree and don't. But right now .. he can't debug, so we go for poor-mans-solution on that.
@Shaun You will give it a value.
So .. do like this.
Create a new console project
copy that method into the Program class
in Main, call that method with "mock" data.
And then we will start putting in throw new Exception() a little bit here and there to get some stacktraces to tell us how far it gest.
and what it gets.
and som console output.
 
oh christ
I miss debugging haha
 
@Shaun what version of VS do you use?
 
2012
I can debug on another project, but this one it just says symbols can't be loaded
debugging WCF is so stupid
 
10:15 AM
Hmm ..
i don't think it has anything to do with that..
as someone said ealier .. i think you are building it in release perhaps?
 
nope, debug
 
ok
usually .. the universal sad story about that kind of stuff and VS .. is .. create a new solution
 
it'd take me so long to create a new solution and paste all the service references etc D;
1 second, i'll try fix my debugging
 
Can anyone suggest a reason why my EF is complaining I'm using multiple contexts, when I've wrapped the context in a singleton?
I mean .. is there any way I can check how many ChangeTrackers an object is connected to?
 
ugh
@gurun I think .ToString is the problem
 
10:23 AM
I are can has words. Email to solicitor:
> I would appreciate if you could encourage the landlord's solicitor in the strongest possible terms that their client's prompt action is anticipated.
I can word when I need to.
 
@Shaun on phone..
 
no worries
ping me when you're done :-)
 
will do
 
@mattthrower You have two contexts.
One defined in your code and one in your EF gencode.
 
@sippy OK .... but I'm only instantiating once.
 
10:30 AM
It's complaining that you have multiple defined, so your instantiation won't work.
 
@sippy Yeah ... after you pointed that out, it looks like the singleton is in the wrong place. I need to wrap the original context, not the repository.
@sippy Thanks
 
Np
 
you at work sipps
 
200 miles away lying on a couch hungover
 
loool
is it possible to do a cmd.CommandText = "SELECT * FROM RESERVED_SEATS";
but have it so like
WHERE ORIG_LOG (table) = OrigLocDB (my variable)
 
10:38 AM
@shan
did you create the console project?
 
cmd.CommandText = "SELECT * FROM RESERVED_SEATS WHERE ORIG_LOG =" + OrigLocDB;
would that work?
 
yes
it's just text
 
I mean as a query
I think I'm going about it the wrong way
 
you need to single quote the value though
 
example?
 
10:39 AM
yes shaun, you are going about this the wrong way .. but .. learning is .. well. that is what you do right.
So, what you should do
is look at the "END RESULT" of all this..
You want to have RESERVED_SEATS
in the end
 
indeed
 
so you should write a SQL that gets that out directly instead. One SQL for it all
something like "select * from reserved_seats rs join daily_schedules ds on ds.thisandthat = rs.thisandathat"
that kind of SQL
 
but then what about the if?
It can only choose the particular reserved_seats depending on the current ORIC_LOG
 
and to feed it with parameters you do something like this "SELECT * FROM Customers WHERE CustomerID = :pCustomerID"
yes, then you do a WHERE ds.ORIC_LOG = 'whatever'
basically .. you take two tabels that are joins by a column value (i have to assume there is something). And then you just use a WHERE condition on the "whole" joined table.
they are joined by TRAIN_ID right?
so, I'll help you write the query. And you will take away the comments from the command parameters you commented out, allright.
On the upside of things.. my Minecraft server in C# for Pocket Edition is accepting connections from iPad :-)
 
10:56 AM
@gurun I'm going for my lunch, will you be here in 30 minutes? :)
 
@Shaun sure thing. I'll be around.
 
11:24 AM
What is difference between ViewData/ViewBag/TempData beside Viewbag doesnt requires typecasting and Vewdata and Tempdata requires typecasting... ?? I searched on this but not got anything besides it.. do anyone knows???
 
@Freelancer ViewData and ViewBag are the same things. ViewBag is just a dynamic wrapper for it. TempData actually preserves over different requests and can be pulled out once.
 
11:45 AM
@gurun you there?
 
12:03 PM
nopCommerce anyone?
 
what you making marek
 
Commerce based upon NOP would be quite dull.
 
How would I go about storing the results of this query "cmd.CommandText = "SELECT ds.TRAIN_ID FROM DAILY_SCHEDULES ds INNER JOIN RESERVED_COACHES rs ON ds.TRAIN_ID = rs.TRAIN_ID WHERE ds.ORIG_LOC =" + ORIG_LOC + "AND ds.PLAN_WRK_ORIG_DEP=" + PLAN_WRK_ORIG_DEP + "AND ds.UWTTID =" + uwttid;" into a Variable I can use for comparison?
 
You mean like a predicate?
/ comparitor?
 
Those words mean nothing to me :'3
I've never used a Predicate before
 
12:15 PM
Look them up :)
 
12:41 PM
Hi all, can I please ask you to take a look at my question?
It will take anyone of you a second to give me the answer, It's just that I am a nooby.
http://stackoverflow.com/questions/25995167/how-to-hold-parent-child-c-sharp-relationship-with-entity-framework
 
@Bergkamp it's quite a vague question.
 
Thank you for your time, The content can be manifested as File, Video, etc.
 
It's still not very clear what you're asking, or what you've tried yourself.
 
I want to be able to address all my different contents as Content and then proceed to their "child".
e.g.
Content _c = new Content(5);
_c.File.Path;
 
Add example use cases to the question and you'll probably get a better response. Also add your own research efforts.
 
12:48 PM
Ok.
Isn't there's a right way of doing that when you share PK's?
 
There are few "right" ways of doing things in general, there are just pros and cons to each option. Of course, people will still shove their favourite way of doing things down your throat, but make sure you see the logic behind the answer; otherwise you have no idea if it's even a good solution or they're just quoting crap they've also been told and not understood.
For example OOP is massively overused because it's almost a buzzword nowadays. OOP is not the solution to every problem.
C# is geared towards it, however.
 
Ok, thanks. I appreciate your time.
 
No worries, ping me if you get stuck with something like this @Bergkamp
 
Thanks @OMGtechy
 
Can oracle support nested datareaders?
 
1:01 PM
are you using DB first @Bergkamp
normally your entity poco classes would have navigational properties
for reference entities
so if it's one to one relationship, Content class will have File property and File class will have Content property
 
Hello. Do you now if this can be translate in VB ? : context.Database.Log = Console.Write
It's about logging SQL request from EF...
 
I tried ;-)
The Console.Write doesn't seems to be right.
If I read if well, it's a delegate assignemnt, right ?
 
no clue
 
Let's loose some more hours...
:-/
Any ressource were I can find how to trace requests build on SaveChanges with VB ?
 
1:09 PM
@gurun
 
seems like Console.Write is used for testing
so execution of EF queries is written to consoles
console window* not xbox
 
Console.write requests params in vb
I think they are not really the same beast in C# and vb
In this example, when they talk about BlogContext, that's their dbContext, right ?
 
yes
db.Log = Console.Out
Dim custQuery = _
From cust In db.Customers _
Where cust.City = "London" _
Select cust

For Each custObj In custQuery
Console.WriteLine(custObj.CustomerID)
Next
 
context.Database.Log = Sub(val) Console.Write(val)
 
http://pastie.org/9587720

By doing this, will the value of TrainID stay permanent or does it only have that value while in the while?

If it does, how can I use it outside of the while?
 
1:16 PM
@Shaun it will have whatever the last value you set it to
 
@drch how can I use TrainID outside of that while? Whenever I try to use it it says it's been unassigned
 
did you debug it?
perhaps your query doesn't return any results
 
that's just a vs error
doesn't actually appear at runtime
 
you have to initialize it in the first place
string TrainId = null;
 
oh okay
duh!
 
1:18 PM
because heuristically, its possible that the value is never assigned
 
TrainID = dr2["ds.TRAIN_ID"].ToString(); is this the correct term to assign it that value?
I'm not sure if that sets it as that value or would just return that as a string
 
@drch This seems to be a vb translation indeed.
 
quick, anybody know the dif between Convert.ToString() and normal ToString() ;)
3,
 
use resharper @Shaun
 
2
1
 
1:20 PM
its quite useful for picking such code inconsistencies
 
@Nathvi convert looks for registered type converters
the fallback is foo.ToString() iirc
 
I was going to mention the nullable string is handled by Convert.ToString()
 
So the query should appear in the Debug window ?
 
yeah, null.ToString() will throw, but null + "" will not
@Rabskatran no
 
Where ?
 
1:22 PM
stdout
 
is this you two saying I should use Convert.ToString loool
 
I feel like Bart in front of a nuclear plant...
How can I see those quieries ?
 
you could Debug.WriteLine()
or log to a file
then you will see it in the debug window, only in debug mode
 
@tranceporter, this is true on the Data Layer, however on my Business Layer I want to be able to get Content and just address the related entity(like File).
 
1:28 PM
@Bergkamp sure you can using navigational property.
var content = _contentRepository.Get(c => c.id == contentId);
var path =content.File == null? string.Empty : content.File.Path;
 
@tranceporter, ok, sounds good.
Let me run some tests and I will ping you if any further help is needed (and you're available) :)
 
@Bergkamp sure. tell me this. do you already have a database?
or you creating it using code first?
 
Database exists. I am using db first.
the entire app is almost completed, I just want this to be perfect. kind of an issue for me
@tranceporter
 
Ah ok
so you using .edmx then?
for generating entity classes?
 
yes.
 
1:33 PM
a good alternative to .edmx
However it does not support stored procs yet
 
That's not an alternative. It's spinning the entire workflow around.
 
just tables
true @RoelvanUden
but tools have their pros and cons though
If DB is huge, i run poco generator in a scratch project
otherwise .edmx is fine
It's not exactly code first though.
 
Nobody in their right mind would want code-first table generation if you have some competence in designing and managing databases.
 
thanks @tranceporter and @RoelvanUden, but I do not look for changing the whole application now.
I just have this situation that tbl_contents has reference to tbl_files.
 
Any clue to understand why EF add some fields not present in the table when building an INSERT? The name of the field are build with the nameOfALinkedTable_NameOfAFieldOfThisOtherTable...
 
1:38 PM
lol @RoelvanUden Huge databases will loads of tables is quite common than you think :)
opening an .edmx for such a db takes stupid amount of time
Should be a navigation property
Referenced object.
 
That are clues for me ?
 
Let's say i have the Data Layer entities:
tbl_contents and tbl_files
and the two Business Layer classes:
Content and File

now, in order to address the Content class I can just select a LINQ query and get the tbl_contents entity. for example:
tbl_contents _dbContent = _dbContext.tbk_contents.Find(5)
now, I know from the ContentType that this is a File, and I want to get the Path from the file entity.
I can get it from _dbContent.tbl_files.Path, but I want it to be a part of a File class.

this is the whole issue @tranceporter & @RoelvanUden
 
@tranceporter That's not a reason to completely screw over your DBAs and compatability with other tooling just "because edmx is slow"
 
Addition:
after getting the entity from the db I can Construct the Content class:
Content content = new Content(_dbContent);

How should I hold the File class related to the Content class.
(I cant construct it with:
File file = new File(_dbContent.tbl_file);
this is not a tbl_files entity, it's just a tbl_content entity with reference to tbl_files)
 
@RoelvanUden how am i screwing over a DBA?
our DBA don't even know about EDMX
 
1:45 PM
If you start using code-first, the code is first and controls the database schema. Think vendor lock-in, incompatabilities with open source tooling (such as Linq2Db), and alienation of amazing DBAs.
 
@tranceporter Ok thanks that was it :-)
@drch Thanks for your help !!
 
@OMGtechy, can you look at my last 2 comments here above?
 
@RoelvanUden I have no problem using Reverse POCO. If there is some logic that is very complex, then it can still stay in a stored proc. CRUD stuff can be handled by EF and POCO classes. I don't fancy code first migrations and seeding of data. But at the same time, I dont mind reversing an existing db to code first like poco classes
@Bergkamp are you creating a Content object for insert, or getting in from the database by contentId for example?
 
What's the best way to expose async/sync methods doing IO bound work without duplicating code?
 
mainly getting. although insertion is an option for later
 
1:51 PM
then you can use repository pattern @Bergkamp
or if you want to use DbContext, then dbContext.Content.FirstOrDefault(c => c.ContentId == contentId);
 
@Shoe Without duplicating code? Care to elaborate?
 
I have these two signatures
public async Task<...> MyMethod()
public ... MyMethod()
They do the same thing but one is asynchronous
 
Thanks @tranceporter, that's not related to my specific issue.

I am just looking on how to hold my "sharing-PK-classes"
 
@Shoe Are the synchronous versions temporary while you are migrating to a full async approach?
 
Sort of, sometimes synchronous calls have to be made
 
1:55 PM
The whole benefit of async comes from having the entire solution support it. Having synchronous versions of stuff is considered bad in this case. In any case, if it's purely for migration, call the Async version and return .Result (return MyMethodAsync(params).Result;). This is bad for performance.
I suggest going full-on async, or don't bother at all.
 
The sync methods are called from background job processes in asp.net. They are fine there
 
Why not make those async as well? No need to have blocking crap around anymore.
 
Because the job processor doesn't support that yet
 
Update it :P
 
I am just one man lol
Is there a way to asynchronously call the synchronous method?
(Or a good way)
 

« first day (1438 days earlier)      last day (3515 days later) »